Qt 4.8
Static Public Functions | List of all members
QKbdDriverFactory Class Reference

The QKbdDriverFactory class creates keyboard drivers in Qt for Embedded Linux. More...

#include <qkbddriverfactory_qws.h>

Static Public Functions

static QWSKeyboardHandlercreate (const QString &, const QString &)
 
static QStringList keys ()
 Returns the list of valid keys, i.e. More...
 

Detailed Description

The QKbdDriverFactory class creates keyboard drivers in Qt for Embedded Linux.

Note that this class is only available in Qt for Embedded Linux.

QKbdDriverFactory is used to detect and instantiate the available keyboard drivers, allowing Qt for Embedded Linux to load the preferred driver into the server application at runtime. The create() function returns a QWSKeyboardHandler object representing the keyboard driver identified by a given key. The valid keys (i.e. the supported drivers) can be retrieved using the keys() function.

Qt for Embedded Linux provides several built-in keyboard drivers. In addition, custom keyboard drivers can be added using Qt's plugin mechanism, i.e. by subclassing the QWSKeyboardHandler class and creating a keyboard driver plugin (QKbdDriverPlugin). See the Qt for Embedded Linux Character Input{character input} documentation for details.

See also
QWSKeyboardHandler, QKbdDriverPlugin

Definition at line 58 of file qkbddriverfactory_qws.h.

Functions

◆ create()

static QWSKeyboardHandler* QKbdDriverFactory::create ( const QString ,
const QString  
)
static

Referenced by QWSServer::openKeyboard().

◆ keys()

QStringList QKbdDriverFactory::keys ( )
static

Returns the list of valid keys, i.e.

the available keyboard drivers.

See also
create()

Definition at line 155 of file qkbddriverfactory_qws.cpp.

156 {
157  QStringList list;
158 
159 #if defined(Q_OS_QNX) && !defined(QT_NO_QWS_KBD_QNX)
160  list << QLatin1String("QNX");
161 #endif
162 #if defined(Q_OS_INTEGRITY) && !defined(QT_NO_QWS_KBD_INTEGRITY)
163  list << QLatin1String("INTEGRITY");
164 #endif
165 #ifndef QT_NO_QWS_KBD_TTY
166  list << QLatin1String("TTY");
167 #endif
168 #ifndef QT_NO_QWS_KBD_LINUXINPUT
169  list << QLatin1String("LinuxInput");
170 #endif
171 #ifndef QT_NO_QWS_KBD_UM
172  list << QLatin1String("UM");
173 #endif
174 
175 #if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL)
176 #ifndef QT_NO_LIBRARY
177  QStringList plugins = loader()->keys();
178  for (int i = 0; i < plugins.size(); ++i) {
179  if (!list.contains(plugins.at(i)))
180  list += plugins.at(i);
181  }
182 #endif //QT_NO_LIBRARY
183 #endif //QT_MAKEDLL
184 
185  return list;
186 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

The documentation for this class was generated from the following files: