IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QKeySequenceEdit Class

The QKeySequenceEdit widget allows to input a QKeySequence.

This class was introduced in Qt 5.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QKeySequenceEdit Class

  • Header: QKeySequenceEdit

  • Since: Qt 5.2

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Widgets)

    target_link_libraries(mytarget PRIVATE Qt6::Widgets)

  • qmake: QT += widgets

  • Inherits: QWidget

Detailed Description

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.

See Also

Property Documentation

 

[since 6.4] clearButtonEnabled : bool

This property holds whether the key sequence edit displays a clear button when it is not empty.

If enabled, the key sequence edit displays a trailing clear button when it contains some text, otherwise the line edit does not show a clear button (the default).

This property was introduced in Qt 6.4.

Access functions:

  • bool isClearButtonEnabled() const

  • void setClearButtonEnabled(bool enable)

keySequence : QKeySequence

This property contains the currently chosen key sequence.

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

Access functions:

  • keySequence() const

  • void setKeySequence(const &keySequence)

Notifier signal:

  • void keySequenceChanged(const &keySequence)

Member Function Documentation

 

[explicit] QKeySequenceEdit::QKeySequenceEdit(QWidget *parent = nullptr)

Constructs a QKeySequenceEdit widget with the given parent.

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

Constructs a QKeySequenceEdit widget with the given keySequence and parent.

[virtual] QKeySequenceEdit::~QKeySequenceEdit()

Destroys the QKeySequenceEdit object.

void QKeySequenceEdit::clear()

Clears the current key sequence.

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.

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

[override virtual protected] void QKeySequenceEdit::focusOutEvent(QFocusEvent *e)

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

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

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+