QKeySequenceEdit 类

QKeySequenceEdit 小部件允许输入 QKeySequence . 更多...

头: #include <QKeySequenceEdit>
CMake: find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
Since: Qt 5.2
继承: QWidget

特性

公共函数

  QKeySequenceEdit (const QKeySequence & keySequence , QWidget * parent = nullptr)
  QKeySequenceEdit (QWidget * parent = nullptr)
virtual ~QKeySequenceEdit ()
QKeySequence keySequence () const

公共槽

void clear ()
void setKeySequence (const QKeySequence & keySequence )

信号

void editingFinished ()
void keySequenceChanged (const QKeySequence & keySequence )

重实现保护函数

virtual bool event (QEvent * e ) override
virtual void keyPressEvent (QKeyEvent * e ) override
virtual void keyReleaseEvent (QKeyEvent * e ) override
virtual void timerEvent (QTimerEvent * e ) override

详细描述

This widget lets the user choose a QKeySequence , which is usually used as a shortcut. The recording is initiated when the widget receives the focus and ends one second after the user releases the last key.

另请参阅 QKeySequenceEdit::keySequence .

特性文档编制

keySequence : QKeySequence

This property contains the currently chosen key sequence.

The shortcut can be changed by the user or via setter function.

访问函数:

QKeySequence keySequence () const
void setKeySequence (const QKeySequence & keySequence )

通知程序信号:

void keySequenceChanged (const QKeySequence & keySequence )

成员函数文档编制

QKeySequenceEdit:: QKeySequenceEdit (const QKeySequence & keySequence , QWidget * parent = nullptr)

Constructs a QKeySequenceEdit widget with the given keySequence and parent .

QKeySequenceEdit:: QKeySequenceEdit ( QWidget * parent = nullptr)

Constructs a QKeySequenceEdit widget with the given parent .

[slot] void QKeySequenceEdit:: clear ()

Clears the current key sequence.

[signal] void QKeySequenceEdit:: editingFinished ()

This signal is emitted when the user finishes entering the shortcut.

注意: there is a one second delay before releasing the last key and emitting this signal.

[虚拟] QKeySequenceEdit:: ~QKeySequenceEdit ()

销毁 QKeySequenceEdit 对象。

[override virtual protected] bool QKeySequenceEdit:: event ( QEvent * e )

重实现: QWidget::event (QEvent *event).

[override virtual protected] void QKeySequenceEdit:: keyPressEvent ( QKeyEvent * e )

重实现: QWidget::keyPressEvent (QKeyEvent *event).

[override virtual protected] void QKeySequenceEdit:: keyReleaseEvent ( QKeyEvent * e )

重实现: QWidget::keyReleaseEvent (QKeyEvent *event).

[override virtual protected] void QKeySequenceEdit:: timerEvent ( QTimerEvent * e )

重实现: QObject::timerEvent (QTimerEvent *event).