-rw-r--r-- | library/qpemenubar.cpp | 16 | ||||
-rw-r--r-- | library/qpemenubar.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/library/qpemenubar.cpp b/library/qpemenubar.cpp index 39f8fd6..bb3ad8d 100644 --- a/library/qpemenubar.cpp +++ b/library/qpemenubar.cpp | |||
@@ -301,8 +301,24 @@ QPEMenuBar::~QPEMenuBar() | |||
301 | /*! | 301 | /*! |
302 | \internal | 302 | \internal |
303 | */ | 303 | */ |
304 | void QPEMenuBar::keyPressEvent( QKeyEvent *e ) | 304 | void QPEMenuBar::keyPressEvent( QKeyEvent *e ) |
305 | { | 305 | { |
306 | QMenuBar::keyPressEvent( e ); | 306 | QMenuBar::keyPressEvent( e ); |
307 | } | 307 | } |
308 | 308 | ||
309 | |||
310 | void QPEMenuBar::activateItem( int index ) | ||
311 | { | ||
312 | activateItemAt( index ); | ||
313 | } | ||
314 | |||
315 | void QPEMenuBar::goodbye() | ||
316 | { | ||
317 | activateItemAt(-1); | ||
318 | for ( unsigned int i = 0; i < count(); i++ ) { | ||
319 | QMenuItem *mi = findItem( idAt(i) ); | ||
320 | if ( mi->popup() ) { | ||
321 | mi->popup()->hide(); | ||
322 | } | ||
323 | } | ||
324 | } | ||
diff --git a/library/qpemenubar.h b/library/qpemenubar.h index 736b12b..5bfbe83 100644 --- a/library/qpemenubar.h +++ b/library/qpemenubar.h | |||
@@ -60,12 +60,14 @@ class QPEMenuBar : public QMenuBar | |||
60 | { | 60 | { |
61 | Q_OBJECT | 61 | Q_OBJECT |
62 | public: | 62 | public: |
63 | QPEMenuBar( QWidget *parent=0, const char* name=0 ); | 63 | QPEMenuBar( QWidget *parent=0, const char* name=0 ); |
64 | ~QPEMenuBar(); | 64 | ~QPEMenuBar(); |
65 | 65 | ||
66 | protected: | 66 | protected: |
67 | virtual void keyPressEvent( QKeyEvent *e ); | 67 | virtual void keyPressEvent( QKeyEvent *e ); |
68 | void activateItem( int index ); | ||
69 | void goodbye(); | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | #endif | 72 | #endif |
71 | 73 | ||