correctly hide the form widgets when a widget is focused

svn path=/trunk/KDE/kdegraphics/okular/; revision=726769
This commit is contained in:
Pino Toscano 2007-10-18 20:35:34 +00:00
parent b975359158
commit 7f44aafa94
2 changed files with 6 additions and 2 deletions

View file

@ -2489,7 +2489,8 @@ void PageView::toggleFormWidgets( bool on )
QVector< PageViewItem * >::const_iterator dIt = d->items.begin(), dEnd = d->items.end();
for ( ; dIt != dEnd; ++dIt )
{
somehadfocus = somehadfocus || (*dIt)->setFormWidgetsVisible( on );
bool hadfocus = (*dIt)->setFormWidgetsVisible( on );
somehadfocus = somehadfocus || hadfocus;
}
if ( somehadfocus )
setFocus();

View file

@ -123,7 +123,10 @@ bool PageViewItem::setFormWidgetsVisible( bool visible )
bool somehadfocus = false;
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
somehadfocus = somehadfocus || (*it)->setVisibility( visible );
{
bool hadfocus = (*it)->setVisibility( visible );
somehadfocus = somehadfocus || hadfocus;
}
return somehadfocus;
}