summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-05-30 20:31:18 (UTC)
committer harlekin <harlekin>2002-05-30 20:31:18 (UTC)
commit82f086d29f36ca631d26f8a4a70fd1e809c58364 (patch) (side-by-side diff)
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()
/*!
Constructs a QPEMenuBar just as you would construct
a QMenuBar, passing \a parent and \a name.
*/
QPEMenuBar::QPEMenuBar( QWidget *parent, const char *name )
: QMenuBar( parent, name )
{
}
/*!
\reimp
*/
QPEMenuBar::~QPEMenuBar()
{
}
/*!
\internal
*/
void QPEMenuBar::keyPressEvent( QKeyEvent *e )
{
QMenuBar::keyPressEvent( e );
}
+
+void QPEMenuBar::activateItem( int index )
+{
+ activateItemAt( index );
+}
+
+void QPEMenuBar::goodbye()
+{
+ activateItemAt(-1);
+ for ( unsigned int i = 0; i < count(); i++ ) {
+ QMenuItem *mi = findItem( idAt(i) );
+ if ( mi->popup() ) {
+ mi->popup()->hide();
+ }
+ }
+}
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:
void setFocus( QWidget *w, bool next=TRUE );
bool eventFilter( QObject *object, QEvent *event );
private slots:
void deactivate();
private:
typedef QGuardedPtr<QWidget> GuardedWidget;
QValueList<GuardedWidget> list;
GuardedWidget inFocus;
GuardedWidget oldFocus;
static QPEMenuToolFocusManager *me;
};
class QPEMenuBar : public QMenuBar
{
Q_OBJECT
public:
QPEMenuBar( QWidget *parent=0, const char* name=0 );
~QPEMenuBar();
protected:
virtual void keyPressEvent( QKeyEvent *e );
+ void activateItem( int index );
+ void goodbye();
};
#endif