QKeyCombination#

The QKeyCombination class stores a combination of a key with optional modifiers. More

Synopsis#

Functions#

Static functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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

See also

QKeySequence

class PySide6.QtCore.QKeyCombination(modifiers[, key=Qt.Key_unknown])#

PySide6.QtCore.QKeyCombination(arg__1)

PySide6.QtCore.QKeyCombination([key=Qt.Key_unknown])

PySide6.QtCore.QKeyCombination(modifiers, key)

Parameters:

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

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

See also

key()

static PySide6.QtCore.QKeyCombination.fromCombined(combined)#
Parameters:

combined – int

Return type:

PySide6.QtCore.QKeyCombination

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 Key and value of type KeyboardModifiers . toCombined() can be used in order to produce valid values for combined.

See also

toCombined()

PySide6.QtCore.QKeyCombination.key()#
Return type:

Key

Returns the key represented by this QKeyCombination object.

PySide6.QtCore.QKeyCombination.keyboardModifiers()#
Return type:

Combination of Qt.KeyboardModifier

Returns the keyboard modifiers represented by this QKeyCombination object.

See also

key()

PySide6.QtCore.QKeyCombination.__ne__(rhs)#
Parameters:

rhsPySide6.QtCore.QKeyCombination

Return type:

bool

Returns true if lhs and rhs have different combinations of key and modifiers, otherwise false.

PySide6.QtCore.QKeyCombination.__eq__(rhs)#
Parameters:

rhsPySide6.QtCore.QKeyCombination

Return type:

bool

Returns true if lhs and rhs have the same combination of key and modifiers, and false otherwise.

PySide6.QtCore.QKeyCombination.toCombined()#
Return type:

int

Returns an integer value obtained by applying a bitwise OR between the values of key() and keyboardModifiers() represented by this object. A QKeyCombination object can be created from the returned integer value by using fromCombined() .