mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
made NativeShortcut private, some mods
This commit is contained in:
+42
-1
@@ -12,13 +12,16 @@ public:
|
||||
QHotkeyPrivate();//singleton!!!
|
||||
~QHotkeyPrivate();
|
||||
|
||||
static QHotkeyPrivate *instance();
|
||||
|
||||
// QAbstractNativeEventFilter interface
|
||||
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
|
||||
|
||||
QHotkey::NativeShortcut nativeShortcut(Qt::Key keycode, Qt::KeyboardModifiers modifiers);
|
||||
bool hasShortcut(Qt::Key keycode, Qt::KeyboardModifiers modifiers);
|
||||
|
||||
bool addShortcut(QHotkey *hotkey);
|
||||
bool removeShortcut(QHotkey *hotkey);//platform implement
|
||||
bool removeShortcut(QHotkey *hotkey);
|
||||
|
||||
private:
|
||||
QMutex mutex;
|
||||
@@ -33,4 +36,42 @@ private:
|
||||
bool unregisterShortcut(QHotkey::NativeShortcut shortcut);//platform implement
|
||||
};
|
||||
|
||||
uint qHash(QHotkey::NativeShortcut key, uint seed = 0);
|
||||
|
||||
|
||||
|
||||
// ---------- QHotkey::NativeShortcut implementation ----------
|
||||
|
||||
inline QHotkey::NativeShortcut::NativeShortcut() :
|
||||
key(0),
|
||||
mods(0)
|
||||
{}
|
||||
|
||||
inline QHotkey::NativeShortcut::NativeShortcut(const QHotkey::NativeShortcut &other) :
|
||||
key(other.key),
|
||||
mods(other.mods)
|
||||
{}
|
||||
|
||||
inline QHotkey::NativeShortcut &QHotkey::NativeShortcut::operator =(const QHotkey::NativeShortcut &other)
|
||||
{
|
||||
this->key = other.key;
|
||||
this->mods = other.mods;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline bool QHotkey::NativeShortcut::isValid() const
|
||||
{
|
||||
return (this->key != 0);
|
||||
}
|
||||
|
||||
inline bool QHotkey::NativeShortcut::operator==(const QHotkey::NativeShortcut &other) const
|
||||
{
|
||||
return (this->key == other.key && this->mods == other.mods);
|
||||
}
|
||||
|
||||
inline uint qHash(QHotkey::NativeShortcut key, uint seed)
|
||||
{
|
||||
return qHash(key.key ^ key.mods, seed);
|
||||
}
|
||||
|
||||
#endif // QHOTKEY_P_H
|
||||
|
||||
Reference in New Issue
Block a user