added doxyfile and begin doc

This commit is contained in:
Skycoder42
2016-02-08 14:25:59 +01:00
parent f8432f8a8b
commit 1007dd07bc
4 changed files with 2546 additions and 1 deletions
+3 -1
View File
@@ -4,4 +4,6 @@ SUBDIRS += \
HotkeyTest HotkeyTest
DISTFILES += README.md \ DISTFILES += README.md \
LICENSE LICENSE \
doc/qhotkey.doxy \
doc/qhotkey.dox
+16
View File
@@ -18,30 +18,46 @@ class QHotkey : public QObject
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut RESET resetShortcut) Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut RESET resetShortcut)
public: public:
//! Defines shortcut with native keycodes
typedef QPair<quint32, quint32> NativeShortcut; typedef QPair<quint32, quint32> NativeShortcut;
//! Constructor
explicit QHotkey(QObject *parent = 0); explicit QHotkey(QObject *parent = 0);
//! Constructs a hotkey with a shortcut and optionally registers it
explicit QHotkey(const QKeySequence &shortcut, bool autoRegister = true, QObject *parent = 0); explicit QHotkey(const QKeySequence &shortcut, bool autoRegister = true, QObject *parent = 0);
//! Constructs a hotkey with a key and modifiers and optionally registers it
explicit QHotkey(Qt::Key key, Qt::KeyboardModifiers modifiers, bool autoRegister = true, QObject *parent = 0); explicit QHotkey(Qt::Key key, Qt::KeyboardModifiers modifiers, bool autoRegister = true, QObject *parent = 0);
//! Destructor
~QHotkey(); ~QHotkey();
//! Test if a certain key with modifiers is currently registered somewhere or not
static bool isKeyCaptured(Qt::Key key, Qt::KeyboardModifiers modifiers); static bool isKeyCaptured(Qt::Key key, Qt::KeyboardModifiers modifiers);
//! READ-Accessor for QHotkey::registered
bool isRegistered() const; bool isRegistered() const;
//! READ-Accessor for QHotkey::shortcut
QKeySequence shortcut() const; QKeySequence shortcut() const;
//! The key-code of the current shortcut
Qt::Key keyCode() const; Qt::Key keyCode() const;
//! The modifiers of the current shortcut
Qt::KeyboardModifiers modifiers() const; Qt::KeyboardModifiers modifiers() const;
public slots: public slots:
//! WRITE-Accessor for QHotkey::registered
bool setRegistered(bool registered); bool setRegistered(bool registered);
//! WRITE-Accessor for QHotkey::shortcut
bool setShortcut(const QKeySequence& shortcut, bool autoRegister = true); bool setShortcut(const QKeySequence& shortcut, bool autoRegister = true);
//! WRITE-Accessor for QHotkey::shortcut
bool setShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers, bool autoRegister = true); bool setShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers, bool autoRegister = true);
//! RESET-Accessor for QHotkey::shortcut
bool resetShortcut(); bool resetShortcut();
signals: signals:
//! Will be emitted if the shortcut is pressed
void activated(); void activated();
//! NOTIFY-Accessor for QHotkey::registered
void registeredChanged(bool registered); void registeredChanged(bool registered);
private: private:
View File
+2527
View File
File diff suppressed because it is too large Load Diff