[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdeui/widgets
From: David Faure <faure () kde ! org>
Date: 2010-08-18 0:14:28
Message-ID: 20100818001428.A2593AC855 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1164923 by dfaure:
Simplify the code using isAncestorOf which I hadn't noticed at the time (thanks André!)
CCBUG: 159295
M +1 -14 ktabwidget.cpp
--- trunk/KDE/kdelibs/kdeui/widgets/ktabwidget.cpp #1164922:1164923
@@ -536,19 +536,6 @@
emit( mouseMiddleClick( widget( index ) ) );
}
-// Helper: return true if w is inside parent (directly or indirectly)
-static bool isWidgetInside(QWidget* w, QWidget* parent)
-{
- while (w) {
- if (w == parent)
- return true;
- if (w->isWindow())
- break;
- w = w->parentWidget();
- }
- return false;
-}
-
void KTabWidget::moveTab( int from, int to )
{
setUpdatesEnabled(false);
@@ -570,7 +557,7 @@
// Don't lose focus due to moving the tab (#159295)
// (removeTab hides the widget, which gives focus to the "next in chain", could be anything)
- if (isWidgetInside(fw, w)) {
+ if (w->isAncestorOf(fw)) {
fw->setFocus();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic