Skip to content

PythonQt.QtGui.QShortcut · declarations 001

Back to PythonQt.QtGui.QShortcut

activated

activated(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QShortcut.activated; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QShortcut::activated()

This signal is emitted when the user types the shortcut's key sequence.

See also activatedAmbiguously().

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#activated

activatedAmbiguously

activatedAmbiguously(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QShortcut.activatedAmbiguously; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QShortcut::activatedAmbiguously()

When a key sequence is being typed at the keyboard, it is said to be ambiguous as long as it matches the start of more than one shortcut.

When a shortcut's key sequence is completed, activatedAmbiguously() is emitted if the key sequence is still ambiguous (i.e., it is the start of one or more other shortcuts). The activated() signal is not emitted in this case.

See also activated().

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#activatedAmbiguously

autoRepeat instance-attribute

autoRepeat: bool

Qt 5 reference:

autoRepeat : bool

This property holds whether the shortcut can auto repeat

If true, the shortcut will auto repeat when the keyboard shortcut combination is held down, provided that keyboard auto repeat is enabled on the system. The default value is true.

This property was introduced in Qt 4.2.

Access functions:

bool autoRepeat() const
void setAutoRepeat(bool on)

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#autoRepeat

context instance-attribute

context: Any

Qt 5 reference:

context : Qt::ShortcutContext

This property holds the context in which the shortcut is valid

A shortcut's context decides in which circumstances a shortcut is allowed to be triggered. The normal context is Qt::WindowShortcut, which allows the shortcut to trigger if the parent (the widget containing the shortcut) is a subwidget of the active top-level window.

By default, this property is set to Qt::WindowShortcut.

Access functions:

Qt::ShortcutContext context() const
void setContext(Qt::ShortcutContext context)

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#context

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QShortcut.destroyed; argument details are not documented.

enabled instance-attribute

enabled: Any

Qt 5 reference:

enabled : bool

This property holds whether the shortcut is enabled

An enabled shortcut emits the activated() or activatedAmbiguously() signal when a QShortcutEvent occurs that matches the shortcut's key() sequence.

If the application is in WhatsThis mode the shortcut will not emit the signals, but will show the "What's This?" text instead.

By default, this property is true.

Access functions:

bool isEnabled() const
void setEnabled(bool enable)

See also whatsThis.

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#enabled

event

event(e: Any) -> bool

X.event(e) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

event(self, e: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#event

id

id() -> int

X.id() -> int

Supplemental documentation: Qt 5 reference:

int QShortcut::id() const

Returns the shortcut's ID.

See also QShortcutEvent::shortcutId().

Upstream PySide2 reference signatures (binding differences may apply):

id(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#id

isEnabled

isEnabled() -> bool

X.isEnabled() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isEnabled(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#isEnabled

key instance-attribute

Qt 5 reference:

key : QKeySequence

This property holds the shortcut's key sequence

This is a key sequence with an optional combination of Shift, Ctrl, and Alt. The key sequence may be supplied in a number of ways:

setKey(0);                  // no signal emitted
setKey(QKeySequence());     // no signal emitted
setKey(0x3b1);              // Greek letter alpha
setKey(Qt::Key_D);              // 'd', e.g. to delete
setKey('q');                // 'q', e.g. to quit
setKey(Qt::CTRL + Qt::Key_P);       // Ctrl+P, e.g. to print document
setKey("Ctrl+P");           // Ctrl+P, e.g. to print document

By default, this property contains an empty key sequence.

Access functions:

QKeySequence key() const
void setKey(const QKeySequence \&key)

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#key

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QShortcut.objectNameChanged; argument details are not documented.

parentWidget

parentWidget() -> Any

X.parentWidget() -> PythonQt.QtGui.QWidget

Supplemental documentation: Qt 5 reference:

QWidget *QShortcut::parentWidget() const

Returns the shortcut's parent widget.

Upstream PySide2 reference signatures (binding differences may apply):

parentWidget(self) -> PySide2.QtWidgets.QWidget

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#parentWidget

setAutoRepeat

setAutoRepeat(on: bool) -> None

X.setAutoRepeat(on)

Upstream PySide2 reference signatures (binding differences may apply):

setAutoRepeat(self, on: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#setAutoRepeat

setContext

setContext(context: Any) -> None

X.setContext(context)

Upstream PySide2 reference signatures (binding differences may apply):

setContext(self, context: PySide2.QtCore.Qt.ShortcutContext) -> None

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#setContext

setEnabled

setEnabled(enable: bool) -> None

X.setEnabled(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setEnabled(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#setEnabled

setKey

setKey(key: Any) -> None

X.setKey(key)

Upstream PySide2 reference signatures (binding differences may apply):

setKey(self, key: PySide2.QtGui.QKeySequence) -> None

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#setKey

setWhatsThis

setWhatsThis(text: str) -> None

X.setWhatsThis(text)

Upstream PySide2 reference signatures (binding differences may apply):

setWhatsThis(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#setWhatsThis

whatsThis instance-attribute

whatsThis: str

Qt 5 reference:

whatsThis : QString

This property holds the shortcut's "What's This?" help text

The text will be shown when the application is in "What's This?" mode and the user types the shortcut key() sequence.

To set "What's This?" help on a menu item (with or without a shortcut key), set the help on the item's action.

By default, this property contains an empty string.

Access functions:

QString whatsThis() const
void setWhatsThis(const QString \&text)

See also QWhatsThis::inWhatsThisMode() and QAction::setWhatsThis().

Source: https://doc.qt.io/archives/qt-5.15/qshortcut.html#whatsThis