TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Member Functions | Private Attributes | List of all members
MusicHotKeyManager Class Reference

The class of the global hotkey setting manager. More...

#include <musichotkeymanager.h>

+ Inheritance diagram for MusicHotKeyManager:

Public Member Functions

void addHotKey (QObject *object)
 
void addHotKey (QObject *object, const char *slot)
 
void addHotKey (QObject *object, const QString &key, const char *slot)
 
void setHotKey (int index, const QString &key)
 
QObject * hotKey (int index)
 
void unsetShortcut ()
 
void setEnabled (bool enabled)
 
void setEnabled (int index, bool enabled)
 
bool isEnabled (int index)
 
QString toString (int key, int modifiers)
 
int count () const
 
QStringList defaultKeys () const
 
QStringList keys () const
 

Private Attributes

QList< QGlobalShortcut * > m_hotkeys
 

Detailed Description

The class of the global hotkey setting manager.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 29 of file musichotkeymanager.h.

Member Function Documentation

void MusicHotKeyManager::addHotKey ( QObject *  object)

Add hotKey by given object.

Definition at line 6 of file musichotkeymanager.cpp.

References m_hotkeys.

void MusicHotKeyManager::addHotKey ( QObject *  object,
const char *  slot 
)

Add hotKey by given object and slot.

Definition at line 12 of file musichotkeymanager.cpp.

References m_hotkeys.

void MusicHotKeyManager::addHotKey ( QObject *  object,
const QString &  key,
const char *  slot 
)

Add hotKey by given object key and slot.

Definition at line 20 of file musichotkeymanager.cpp.

References m_hotkeys.

int MusicHotKeyManager::count ( ) const

Get hotkey count.

Definition at line 108 of file musichotkeymanager.cpp.

References m_hotkeys.

QStringList MusicHotKeyManager::defaultKeys ( ) const

Get default key string.

Definition at line 113 of file musichotkeymanager.cpp.

References keys().

QObject * MusicHotKeyManager::hotKey ( int  index)

Get the object key by given hotKey index.

Definition at line 38 of file musichotkeymanager.cpp.

References m_hotkeys.

bool MusicHotKeyManager::isEnabled ( int  index)

check the given hotkey is enabled or not.

Definition at line 75 of file musichotkeymanager.cpp.

References m_hotkeys.

QStringList MusicHotKeyManager::keys ( ) const

Get key string.

Definition at line 121 of file musichotkeymanager.cpp.

References key, m_hotkeys, and qAsConst.

Referenced by defaultKeys().

void MusicHotKeyManager::setEnabled ( bool  enabled)

Enable or disable all hotkeys.

Definition at line 57 of file musichotkeymanager.cpp.

References key, m_hotkeys, and qAsConst.

void MusicHotKeyManager::setEnabled ( int  index,
bool  enabled 
)

Enable or disable the hotkey by index.

Definition at line 65 of file musichotkeymanager.cpp.

References m_hotkeys.

void MusicHotKeyManager::setHotKey ( int  index,
const QString &  key 
)

Set hotKey by given index and string key.

Definition at line 28 of file musichotkeymanager.cpp.

References m_hotkeys.

QString MusicHotKeyManager::toString ( int  key,
int  modifiers 
)

Mapping the virtual key to string key.

Definition at line 85 of file musichotkeymanager.cpp.

void MusicHotKeyManager::unsetShortcut ( )

Unset registered hotKeys.

Definition at line 48 of file musichotkeymanager.cpp.

References key, m_hotkeys, and qAsConst.

Member Data Documentation

QList<QGlobalShortcut*> MusicHotKeyManager::m_hotkeys
private

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