QKeySequenceEdit#

The QKeySequenceEdit widget allows to input a QKeySequence . More

Inheritance diagram of PySide6.QtWidgets.QKeySequenceEdit

Synopsis#

Properties#

Functions#

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

class PySide6.QtWidgets.QKeySequenceEdit([parent=None])#

PySide6.QtWidgets.QKeySequenceEdit(keySequence[, parent=None])

Parameters:

Constructs a QKeySequenceEdit widget with the given parent.

Constructs a QKeySequenceEdit widget with the given keySequence and parent.

Note

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

property PᅟySide6.QtWidgets.QKeySequenceEdit.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 PᅟySide6.QtWidgets.QKeySequenceEdit.finishingKeyCombinations#

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, Key_Tab and Key_Backtab will finish recording the key sequence.

Access functions:
property PᅟySide6.QtWidgets.QKeySequenceEdit.keySequence: PySide6.QtGui.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 PᅟySide6.QtWidgets.QKeySequenceEdit.maximumSequenceLength: qsizetype#

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:
PySide6.QtWidgets.QKeySequenceEdit.clear()#

Clears the current key sequence.

PySide6.QtWidgets.QKeySequenceEdit.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.

PySide6.QtWidgets.QKeySequenceEdit.finishingKeyCombinations()#

Getter of property finishingKeyCombinations .

PySide6.QtWidgets.QKeySequenceEdit.isClearButtonEnabled()#
Return type:

bool

Getter of property clearButtonEnabled .

PySide6.QtWidgets.QKeySequenceEdit.keySequence()#
Return type:

PySide6.QtGui.QKeySequence

See also

setKeySequence()

Getter of property keySequence .

PySide6.QtWidgets.QKeySequenceEdit.keySequenceChanged(keySequence)#
Parameters:

keySequencePySide6.QtGui.QKeySequence

Notification signal of property keySequence .

PySide6.QtWidgets.QKeySequenceEdit.maximumSequenceLength()#
Return type:

qsizetype

Getter of property maximumSequenceLength .

PySide6.QtWidgets.QKeySequenceEdit.setClearButtonEnabled(enable)#
Parameters:

enable – bool

Setter of property clearButtonEnabled .

PySide6.QtWidgets.QKeySequenceEdit.setFinishingKeyCombinations(finishingKeyCombinations)#
Parameters:

finishingKeyCombinations

Setter of property finishingKeyCombinations .

PySide6.QtWidgets.QKeySequenceEdit.setKeySequence(keySequence)#
Parameters:

keySequencePySide6.QtGui.QKeySequence

See also

keySequence()

Setter of property keySequence .

PySide6.QtWidgets.QKeySequenceEdit.setMaximumSequenceLength(count)#
Parameters:

countqsizetype

Setter of property maximumSequenceLength .