Diffstat (limited to 'libopie2/opieui/okeyconfigwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/okeyconfigwidget.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h index a7a5f48..8d2a1ef 100644 --- a/libopie2/opieui/okeyconfigwidget.h +++ b/libopie2/opieui/okeyconfigwidget.h @@ -250,3 +250,3 @@ private slots: void slotCustomKey(); - + void slotConfigure(); @@ -265,2 +265,41 @@ private: + +/** + * This is a small dialog that allows you to + * capture a key sequence. + * If you want it to close after a key was captured you + * can use this code snippet. + * + * \code + * OKeyChooserConfigDialog diag(0,0,true); + * connect(&diag,SIGNAL(keyCaptured()), + * this,SLOT(accept())); + * if( QPEApplication::execDialog(&diag) == QDialog::Accept ){ + * take_the_key_and_do_something + * } + * + * \endcode + * + */ +class OKeyChooserConfigDialog : public QDialog { + Q_OBJECT +public: + OKeyChooserConfigDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); + ~OKeyChooserConfigDialog(); + + OKeyPair keyPair()const; + +protected: + void keyPressEvent( QKeyEvent* ); + void keyReleaseEvent( QKeyEvent* ); + +signals: + void keyCaptured(); + +private: + OKeyPair m_keyPair; + class Private; + Private *d; +}; + } |