-rw-r--r-- | library/qpemenubar.cpp | 29 |
1 files changed, 15 insertions, 14 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,2 +249,3 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event ) QChildEvent *ce = (QChildEvent *)event; + if ( ce->child()->isWidgetType() ) { if ( ce->child()->inherits( "QMenuBar" ) ) { @@ -252,7 +253,9 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event ) ce->child()->installEventFilter( this ); - } else if ( object->inherits( "QToolBar" ) && ce->child()->isWidgetType() ) { + } else if ( object->inherits( "QToolBar" ) ) { addWidget( (QWidget *)ce->child() ); } + } } else if ( event->type() == QEvent::ChildRemoved ) { QChildEvent *ce = (QChildEvent *)event; + if ( ce->child()->isWidgetType() ) { if ( ce->child()->inherits( "QMenuBar" ) ) { @@ -260,3 +263,3 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event ) ce->child()->removeEventFilter( this ); - } else if ( object->inherits( "QToolBar" ) && ce->child()->isWidgetType() ) { + } else if ( object->inherits( "QToolBar" ) ) { removeWidget( (QWidget *)ce->child() ); @@ -264,2 +267,3 @@ bool QPEMenuToolFocusManager::eventFilter( QObject *object, QEvent *event ) } + } @@ -281,3 +285,2 @@ void QPEMenuToolFocusManager::deactivate() - \sa QMenuBar */ @@ -308,14 +311,13 @@ 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++ ) { + for ( uint i = 0; i < count(); i++ ) { QMenuItem *mi = findItem( idAt(i) ); - if ( mi->popup() ) { + if (mi->popup() ) mi->popup()->hide(); @@ -323,2 +325 @@ void QPEMenuBar::goodbye() } -} |