Unity 8
GlobalShortcut Class Reference

The GlobalShortcut class. More...

#include <plugins/GlobalShortcut/globalshortcut.h>

Inherits QQuickItem.

Signals

void shortcutChanged (const QVariant &shortcut)
 
void triggered (const QString &shortcut)
 
void activeChanged (bool active)
 

Public Member Functions

 GlobalShortcut (QQuickItem *parent=nullptr)
 
QVariant shortcut () const
 
void setShortcut (const QVariant &shortcut)
 
bool isActive () const
 
void setActive (bool active)
 

Protected Member Functions

void componentComplete () override
 
void keyPressEvent (QKeyEvent *event) override
 

Properties

QVariant shortcut
 
bool active
 

Detailed Description

The GlobalShortcut class.

QML component for registering a shortcut; the shortcut itself can be specified either as a string ("Ctrl+Alt+L") or as an enum value (Qt.ControlModifier|Qt.AltModifier|Qt.Key_L).

When the shortcut is detected, the signal triggered() gets emitted.

Definition at line 33 of file globalshortcut.h.

Member Function Documentation

void GlobalShortcut::triggered ( const QString &  shortcut)
signal

Emitted when a global keypress of shortcut is detected

Property Documentation

bool GlobalShortcut::active
readwrite

Whether the shortcut is active (true by default)

Definition at line 43 of file globalshortcut.h.

QVariant GlobalShortcut::shortcut
readwrite

The shortcut itself

Definition at line 39 of file globalshortcut.h.


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