QKeyCombination Class

  • Header: QKeyCombination

  • Since: Qt 6.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

Detailed Description

The QKeyCombination class can be used to represent a combination of a key with zero or more keyboard modifiers.

See Also

See also QKeySequence

Member Function Documentation

 

[constexpr] QKeyCombination::QKeyCombination(Qt::Key key = Qt::Key_unknown)

Constructs a QKeyCombination object that represents the key key and no modifiers.

See Also

See also key()

[explicit constexpr] QKeyCombination::QKeyCombination(Qt::Modifiers modifiers, Qt::Key key = Qt::Key_unknown)

Constructs a QKeyCombination object that represents the combination of key with the modifiers modifiers.

See Also

See also key(), keyboardModifiers()

[explicit constexpr] QKeyCombination::QKeyCombination(Qt::KeyboardModifiers modifiers, Qt::Key key = Qt::Key_unknown)

Constructs a QKeyCombination object that represents the combination of key with the modifiers modifiers.

See Also

See also key(), keyboardModifiers()

[static constexpr] QKeyCombination QKeyCombination::fromCombined(int combined)

Constructs a QKeyCombination object by extracting the key and the modifiers out of combined, which must be the result of a bitwise OR between a value of type Qt::Key and value of type Qt::KeyboardModifiers. toCombined() can be used in order to produce valid values for combined.

See Also

See also toCombined()

[constexpr] Qt::Key QKeyCombination::key() const

Returns the key represented by this QKeyCombination object.

See Also

See also keyboardModifiers()

[constexpr] Qt::KeyboardModifiers QKeyCombination::keyboardModifiers() const

Returns the keyboard modifiers represented by this QKeyCombination object.

See Also

See also key()

[constexpr] int QKeyCombination::toCombined() const

Returns an integer value obtained by applying a bitwise OR between the values of key() and keyboardModifiers() represented by this object. A