Qt3DInput::QKeyboardHandler Class

Provides keyboard event notification. More...

Header: #include <QKeyboardHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
In QML: KeyboardHandler
Inherits: Qt3DCore::QComponent
Status: Deprecated

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)

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

[explicit] 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().