QKeyCombination 类

QKeyCombination 类存储键和可选修饰符的组合。 更多...

头: #include <QKeyCombination>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0

公共函数

QKeyCombination (Qt::Key key = Qt::Key_unknown)
QKeyCombination (Qt::Modifiers modifiers , Qt::Key key = Qt::Key_unknown)
QKeyCombination (Qt::KeyboardModifiers modifiers , Qt::Key key = Qt::Key_unknown)
Qt::Key key () const
Qt::KeyboardModifiers keyboardModifiers () const
int toCombined () const

静态公共成员

QKeyCombination fromCombined (int combined )
size_t qHash (QKeyCombination key , size_t seed = 0)
bool operator!= (QKeyCombination lhs , QKeyCombination rhs )
QDebug operator<< (QDebug debug , QKeyCombination combination )
QDataStream & operator<< (QDataStream & out , QKeyCombination combination )
bool operator== (QKeyCombination lhs , QKeyCombination rhs )
QDataStream & operator>> (QDataStream & in , QKeyCombination & combination )
QKeyCombination operator| (Qt::Modifier modifier , Qt::Key key )
QKeyCombination operator| (Qt::KeyboardModifier modifier , Qt::Key key )
QKeyCombination operator| (Qt::Key key , Qt::Modifier modifier )
QKeyCombination operator| (Qt::Key key , Qt::KeyboardModifier modifier )
QKeyCombination operator| (Qt::Modifiers modifiers , Qt::Key key )
QKeyCombination operator| (Qt::KeyboardModifiers modifiers , Qt::Key key )
QKeyCombination operator| (Qt::Key key , Qt::Modifiers modifiers )
QKeyCombination operator| (Qt::Key key , Qt::KeyboardModifiers modifiers )

详细描述

QKeyCombination 类可用于表示具有零个或多个键盘修饰符的键组合。

另请参阅 QKeySequence .

成员函数文档编制

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

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

另请参阅 key ().

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

Constructs a QKeyCombination object that represents the combination of key 采用修饰符 modifiers .

另请参阅 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 采用修饰符 modifiers .

另请参阅 key () 和 keyboardModifiers ().

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

构造 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 .

另请参阅 toCombined ().

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

返回表示的键通过此 QKeyCombination 对象。

另请参阅 keyboardModifiers ().

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

返回表示的键盘修饰符通过此 QKeyCombination 对象。

另请参阅 key ().

[constexpr] int QKeyCombination:: toCombined () const

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

另请参阅 fromCombined (), key (),和 keyboardModifiers ().

相关非成员

[constexpr] QKeyCombination operator| ( Qt::Key key , Qt::KeyboardModifier modifier )

[constexpr] QKeyCombination operator| ( Qt::Key key , Qt::Modifier modifier )

[constexpr] QKeyCombination operator| ( Qt::KeyboardModifier modifier , Qt::Key key )

[constexpr] QKeyCombination operator| ( Qt::Modifier modifier , Qt::Key key )

返回 QKeyCombination 对象以表示组合的 key with the modifier modifier .

[constexpr] QKeyCombination operator| ( Qt::Key key , Qt::KeyboardModifiers modifiers )

[constexpr] QKeyCombination operator| ( Qt::Key key , Qt::Modifiers modifiers )

[constexpr] QKeyCombination operator| ( Qt::KeyboardModifiers modifiers , Qt::Key key )

[constexpr] QKeyCombination operator| ( Qt::Modifiers modifiers , Qt::Key key )

返回 QKeyCombination 对象以表示组合的 key 采用修饰符 modifiers .

size_t qHash ( QKeyCombination key , size_t seed = 0)

返回哈希值为 key ,使用 seed 做计算种子。

[constexpr] bool operator!= ( QKeyCombination lhs , QKeyCombination rhs )

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

QDebug operator<< ( QDebug debug , QKeyCombination combination )

写入组合 combination 到 debug 对象 debug 为调试目的。

另请参阅 调试技术 .

QDataStream & operator<< ( QDataStream & out , QKeyCombination combination )

写入组合 combination 进流 out 。返回 out .

另请参阅 序列化 Qt 数据类型 .

[constexpr] bool operator== ( QKeyCombination lhs , QKeyCombination rhs )

返回 true if lhs and rhs have the same combination of key and modifiers, and false 否则。

QDataStream & operator>> ( QDataStream & in , QKeyCombination & combination )

读取组合 combination 从流 in 。返回 in .

另请参阅 序列化 Qt 数据类型 .