summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-05-30 20:31:18 (UTC)
committer harlekin <harlekin>2002-05-30 20:31:18 (UTC)
commit82f086d29f36ca631d26f8a4a70fd1e809c58364 (patch) (unidiff)
tree197cd323a7cdb868c3aa839181fcb7dbb5cab252
parentf4f00234985e5864229b3e95a3ac0d004c09b10d (diff)
downloadopie-82f086d29f36ca631d26f8a4a70fd1e809c58364.zip
opie-82f086d29f36ca631d26f8a4a70fd1e809c58364.tar.gz
opie-82f086d29f36ca631d26f8a4a70fd1e809c58364.tar.bz2
applyed patch from Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>, looks like the qtopia on zaurus has a modified qpemenubar, which prevented PyQt to work with opie right. Potentially closes bug #388 hh.org bugzilla
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpemenubar.cpp16
-rw-r--r--library/qpemenubar.h2
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
@@ -285,24 +285,40 @@ void QPEMenuToolFocusManager::deactivate()
285/*! 285/*!
286 Constructs a QPEMenuBar just as you would construct 286 Constructs a QPEMenuBar just as you would construct
287 a QMenuBar, passing \a parent and \a name. 287 a QMenuBar, passing \a parent and \a name.
288*/ 288*/
289QPEMenuBar::QPEMenuBar( QWidget *parent, const char *name ) 289QPEMenuBar::QPEMenuBar( QWidget *parent, const char *name )
290 : QMenuBar( parent, name ) 290 : QMenuBar( parent, name )
291{ 291{
292} 292}
293 293
294/*! 294/*!
295 \reimp 295 \reimp
296*/ 296*/
297QPEMenuBar::~QPEMenuBar() 297QPEMenuBar::~QPEMenuBar()
298{ 298{
299} 299}
300 300
301/*! 301/*!
302 \internal 302 \internal
303*/ 303*/
304void QPEMenuBar::keyPressEvent( QKeyEvent *e ) 304void QPEMenuBar::keyPressEvent( QKeyEvent *e )
305{ 305{
306 QMenuBar::keyPressEvent( e ); 306 QMenuBar::keyPressEvent( e );
307} 307}
308 308
309
310void QPEMenuBar::activateItem( int index )
311{
312 activateItemAt( index );
313}
314
315void 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
@@ -44,28 +44,30 @@ protected:
44 void setFocus( QWidget *w, bool next=TRUE ); 44 void setFocus( QWidget *w, bool next=TRUE );
45 bool eventFilter( QObject *object, QEvent *event ); 45 bool eventFilter( QObject *object, QEvent *event );
46 46
47private slots: 47private slots:
48 void deactivate(); 48 void deactivate();
49 49
50private: 50private:
51 typedef QGuardedPtr<QWidget> GuardedWidget; 51 typedef QGuardedPtr<QWidget> GuardedWidget;
52 QValueList<GuardedWidget> list; 52 QValueList<GuardedWidget> list;
53 GuardedWidget inFocus; 53 GuardedWidget inFocus;
54 GuardedWidget oldFocus; 54 GuardedWidget oldFocus;
55 static QPEMenuToolFocusManager *me; 55 static QPEMenuToolFocusManager *me;
56}; 56};
57 57
58 58
59class QPEMenuBar : public QMenuBar 59class QPEMenuBar : public QMenuBar
60{ 60{
61 Q_OBJECT 61 Q_OBJECT
62public: 62public:
63 QPEMenuBar( QWidget *parent=0, const char* name=0 ); 63 QPEMenuBar( QWidget *parent=0, const char* name=0 );
64 ~QPEMenuBar(); 64 ~QPEMenuBar();
65 65
66protected: 66protected:
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