summaryrefslogtreecommitdiff
path: root/library/qpemenubar.cpp
authorzecke <zecke>2002-09-10 12:09:49 (UTC)
committer zecke <zecke>2002-09-10 12:09:49 (UTC)
commit6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (side-by-side diff)
tree6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/qpemenubar.cpp
parentd10cddb3c9ce75bc90b14add14bc133737fe35aa (diff)
downloadopie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2
Qtopia1-6 merge
still to test bic changes to be resolved more changes to be made?
Diffstat (limited to 'library/qpemenubar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpemenubar.cpp47
1 files changed, 24 insertions, 23 deletions
diff --git a/library/qpemenubar.cpp b/library/qpemenubar.cpp
index bb3ad8d..f0171ba 100644
--- a/library/qpemenubar.cpp
+++ b/library/qpemenubar.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2001 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -249,7 +249,9 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event )
QChildEvent *ce = (QChildEvent *)event;
- if ( ce->child()->inherits( "QMenuBar" ) ) {
- addWidget( (QWidget *)ce->child() );
- ce->child()->installEventFilter( this );
- } else if ( object->inherits( "QToolBar" ) && ce->child()->isWidgetType() ) {
- addWidget( (QWidget *)ce->child() );
+ if ( ce->child()->isWidgetType() ) {
+ if ( ce->child()->inherits( "QMenuBar" ) ) {
+ addWidget( (QWidget *)ce->child() );
+ ce->child()->installEventFilter( this );
+ } else if ( object->inherits( "QToolBar" ) ) {
+ addWidget( (QWidget *)ce->child() );
+ }
}
@@ -257,7 +259,9 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event )
QChildEvent *ce = (QChildEvent *)event;
- if ( ce->child()->inherits( "QMenuBar" ) ) {
- removeWidget( (QWidget *)ce->child() );
- ce->child()->removeEventFilter( this );
- } else if ( object->inherits( "QToolBar" ) && ce->child()->isWidgetType() ) {
- removeWidget( (QWidget *)ce->child() );
+ if ( ce->child()->isWidgetType() ) {
+ if ( ce->child()->inherits( "QMenuBar" ) ) {
+ removeWidget( (QWidget *)ce->child() );
+ ce->child()->removeEventFilter( this );
+ } else if ( object->inherits( "QToolBar" ) ) {
+ removeWidget( (QWidget *)ce->child() );
+ }
}
@@ -281,3 +285,2 @@ void QPEMenuToolFocusManager::deactivate()
- \sa QMenuBar
*/
@@ -308,16 +311,14 @@ void QPEMenuBar::keyPressEvent( QKeyEvent *e )
-
-void QPEMenuBar::activateItem( int index )
-{
+/*!
+ \internal
+*/
+void QPEMenuBar::activateItem( int index ) {
activateItemAt( index );
}
-
-void QPEMenuBar::goodbye()
-{
+void QPEMenuBar::goodbye() {
activateItemAt(-1);
- for ( unsigned int i = 0; i < count(); i++ ) {
- QMenuItem *mi = findItem( idAt(i) );
- if ( mi->popup() ) {
+ for ( uint i = 0; i < count(); i++ ) {
+ QMenuItem* mi = findItem( idAt(i) );
+ if (mi->popup() )
mi->popup()->hide();
- }
}