Miam-Player  0.8.0
A nice music player
QxtGlobalShortcut Class Reference

QxtWidgets More...

#include <qxtglobalshortcut.h>

Inheritance diagram for QxtGlobalShortcut:

Public Slots

void setEnabled (bool enabled=true)
 
void setDisabled (bool disabled=true)
 Sets the shortcut disabled. More...
 

Signals

void activated ()
 This signal is emitted when the user types the shortcut's key sequence. More...
 

Public Member Functions

 QxtGlobalShortcut (QObject *parent=0)
 Constructs a new QxtGlobalShortcut with parent. More...
 
 QxtGlobalShortcut (const QKeySequence &shortcut, QObject *parent=0)
 Constructs a new QxtGlobalShortcut with shortcut and parent. More...
 
virtual ~QxtGlobalShortcut ()
 Destructs the QxtGlobalShortcut. More...
 
QKeySequence shortcut () const
 
bool setShortcut (const QKeySequence &shortcut)
 
bool isEnabled () const
 

Properties

bool enabled
 whether the shortcut is enabled More...
 
QKeySequence shortcut
 the shortcut key sequence More...
 

Detailed Description

QxtWidgets

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:

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

{Note:} Since Qxt 0.6 QxtGlobalShortcut no more requires QxtApplication.

Constructor & Destructor Documentation

QxtGlobalShortcut::QxtGlobalShortcut ( QObject *  parent = 0)
explicit

Constructs a new QxtGlobalShortcut with parent.

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

Constructs a new QxtGlobalShortcut with shortcut and parent.

QxtGlobalShortcut::~QxtGlobalShortcut ( )
virtual

Destructs the QxtGlobalShortcut.

Member Function Documentation

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
bool QxtGlobalShortcut::setShortcut ( const QKeySequence &  shortcut)
QKeySequence QxtGlobalShortcut::shortcut ( ) const

Property Documentation

QxtGlobalShortcut::enabled
readwrite

whether the shortcut is enabled

A disabled shortcut does not get activated.

The default value is true.

See also
setDisabled()
QKeySequence QxtGlobalShortcut::shortcut
readwrite

the shortcut key sequence

{Note:} Notice that corresponding key press and release events are not delivered for registered global shortcuts even if they are disabled. Also, comma separated key sequences are not supported. Only the first part is used:

qxtShortcut->setShortcut(QKeySequence("Ctrl+Alt+A,Ctrl+Alt+B"));
Q_ASSERT(qxtShortcut->shortcut() == QKeySequence("Ctrl+Alt+A"));

The documentation for this class was generated from the following files: