orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
shortcutkey.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDROQGUI_SHORTCUTKEY_H 00012 #define HYDROQGUI_SHORTCUTKEY_H 00013 00014 #include <QAction> 00015 #include <QKeySequence> 00016 #include <QList> 00017 00018 namespace hydroqguielementutil { 00019 00020 namespace detail{ 00021 00031 class ShortcutKey : public QAction 00032 { 00033 Q_OBJECT 00034 public: 00035 00038 ShortcutKey( QKeySequence keySequence, bool ownExclusively, QObject *parent ); 00039 ~ShortcutKey() {}; 00040 void subscribe( QObject *parent, QAction *action, bool ownExclusively ); 00041 void unsubscribe( QObject *parent ); 00042 QKeySequence key() { return keySequence_; }; 00043 00044 int numSubscribers() const { return actionMap_.size(); } 00045 00046 public slots: 00047 void triggerElementActions(); 00048 00049 private: 00050 QKeySequence keySequence_; 00051 bool isOwnedExclusively_; 00052 00053 // This actionMap_ is a QMultiMap: it allows multiple QAction's 00054 // to be associated with a single QObject. 00055 QMultiMap<QObject*,QAction*> actionMap_; 00056 }; 00057 00058 } 00059 00060 } 00061 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)