class QKeySequenceEdit#

The QKeySequenceEdit widget allows to input a QKeySequence. More

Inheritance diagram of PySide6.QtWidgets.QKeySequenceEdit

Synopsis#

Properties#

Methods#

Slots#

Signals#

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#

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

keySequence

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property 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).

Access functions:
property finishingKeyCombinationsᅟ: list of QKeyCombination#

This property holds The list of key combinations that finish editing the key sequences..

Any combination in the list will finish the editing of key sequences. All other key combinations can be recorded as part of a key sequence. By default, Qt::Key_Tab and Qt::Key_Backtab will finish recording the key sequence.

Access functions:
property keySequenceᅟ: QKeySequence#

This property holds This property contains the currently chosen key sequence..

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

Note

If the QKeySequence is longer than the maximumSequenceLength property, the key sequence is truncated.

Access functions:
property maximumSequenceLengthᅟ: int#

This property holds The maximum sequence length..

The maximum number of key sequences a user can enter. The value needs to be between 1 and 4, with 4 being the default.

Access functions:
__init__([parent=None])#
Parameters:

parentQWidget

Constructs a QKeySequenceEdit widget with the given parent.

__init__(keySequence[, parent=None])
Parameters:

Constructs a QKeySequenceEdit widget with the given keySequence and parent.

clear()#

Clears the current key sequence.

editingFinished()#

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

Note

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

finishingKeyCombinations()#
Return type:

.list of QKeyCombination

Getter of property finishingKeyCombinationsᅟ .

isClearButtonEnabled()#
Return type:

bool

Getter of property clearButtonEnabledᅟ .

keySequence()#
Return type:

QKeySequence

See also

setKeySequence()

Getter of property keySequenceᅟ .

keySequenceChanged(keySequence)#
Parameters:

keySequenceQKeySequence

Notification signal of property keySequenceᅟ .

maximumSequenceLength()#
Return type:

int

Getter of property maximumSequenceLengthᅟ .

setClearButtonEnabled(enable)#
Parameters:

enable – bool

Setter of property clearButtonEnabledᅟ .

setFinishingKeyCombinations(finishingKeyCombinations)#
Parameters:

finishingKeyCombinations – .list of QKeyCombination

Setter of property finishingKeyCombinationsᅟ .

setKeySequence(keySequence)#
Parameters:

keySequenceQKeySequence

See also

keySequence()

Setter of property keySequenceᅟ .

setMaximumSequenceLength(count)#
Parameters:

count – int

Setter of property maximumSequenceLengthᅟ .