Home · Modules · Classes · Namespaces · Functions

QxtGlobalShortcut Class Reference
[QxtGui module]

The QxtGlobalShortcut class provides a global shortcut aka "hotkey". More...

    #include <QxtGlobalShortcut>

Inherits QObject.

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QxtGlobalShortcut class provides a global shortcut aka "hotkey".

A global shortcut triggers even if the application is not active. This makes it easy to implement applications that react to certain shortcuts still if some other application is active or if the application is for example minimized to the system tray.

Example usage:

    QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(window);
    connect(shortcut, SIGNAL(activated()), window, SLOT(toggleVisibility()));
    shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12"));

Note: Since Qxt 0.6 QxtGlobalShortcut no more requires QxtApplication.


Member Function Documentation

QxtGlobalShortcut::QxtGlobalShortcut ( QObject * parent = 0 )

Constructs a new QxtGlobalShortcut with parent.

QxtGlobalShortcut::QxtGlobalShortcut ( const QKeySequence & shortcut, QObject * parent = 0 )

Constructs a new QxtGlobalShortcut with shortcut and parent.

QxtGlobalShortcut::~QxtGlobalShortcut ()   [virtual]

Destructs the QxtGlobalShortcut.

void QxtGlobalShortcut::activated ()   [signal]

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

See also shortcut.

bool QxtGlobalShortcut::isEnabled () const

void QxtGlobalShortcut::setDisabled ( bool disabled = true )   [slot]

Sets the shortcut disabled.

See also enabled.

void QxtGlobalShortcut::setEnabled ( bool enabled = true )   [slot]

See also isEnabled().

bool QxtGlobalShortcut::setShortcut ( const QKeySequence & shortcut )

See also shortcut().

QKeySequence QxtGlobalShortcut::shortcut () const

See also setShortcut().


Copyright © 2007-2010 Qxt Foundation
Qxt 0.7.0