QKeyboardHandler Class

(Qt3DInput::QKeyboardHandler)

Provides keyboard event notification. More...

Header: #include <QKeyboardHandler>
qmake: QT += 3dinput
Since: Qt 5.5
Instantiated By: KeyboardHandler
Inherits: Qt3DCore::QComponent

This class was introduced in Qt 5.5.

Properties

Public Functions

QKeyboardHandler(Qt3DCore::QNode *parent = nullptr)
bool focus() const
Qt3DInput::QKeyboardDevice *sourceDevice() const

Public Slots

void setFocus(bool focus)
void setSourceDevice(Qt3DInput::QKeyboardDevice *keyboardDevice)

Signals

void focusChanged(bool focus)
void sourceDeviceChanged(Qt3DInput::QKeyboardDevice *keyboardDevice)
typedef QNodePtr
typedef QNodeVector
typedef QObjectList
QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
T qobject_cast(QObject *object)
T qobject_cast(const QObject *object)

Macros

Additional Inherited Members

  • 9 static public members inherited from QObject
  • 2 protected functions inherited from Qt3DCore::QNode
  • 9 protected functions inherited from QObject

Detailed Description

Property Documentation

focus : bool

Holds true if the QKeyboardHandlers has focus.

Access functions:

bool focus() const
void setFocus(bool focus)

Notifier signal:

void focusChanged(bool focus)

sourceDevice : Qt3DInput::QKeyboardDevice*

Holds the keyboard device of the QKeyboardHandler. Without a valid device, the QKeyboardHandler won't receive any event.

Access functions:

Qt3DInput::QKeyboardDevice *sourceDevice() const
void setSourceDevice(Qt3DInput::QKeyboardDevice *keyboardDevice)

Notifier signal:

void sourceDeviceChanged(Qt3DInput::QKeyboardDevice *keyboardDevice)

Member Function Documentation

QKeyboardHandler::QKeyboardHandler(Qt3DCore::QNode *parent = nullptr)

Constructs a new QKeyboardHandler instance with parent parent.

[slot] void QKeyboardHandler::setFocus(bool focus)

Sets the focus to focus. If focus is not currently set to true, this component will receive keyboard focus.

Note: Setter function for property focus.

See also focus().

Qt3DInput::QKeyboardDevice *QKeyboardHandler::sourceDevice() const

Returns the current keyboard device.

Note: Getter function for property sourceDevice.

See also setSourceDevice().