Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.2
-
None
-
X11, linux
Description
QTabWidgetPrivate::_q_tabMoved does removeWidget+insertWidget on the widgetstack, which makes the focus jump to whichever the "next focus widget" is, could even be outside the tabwidget.
This prevented me from using QTabBar::moveTab in order to fix https://bugs.kde.org/show_bug.cgi?id=159295 because both pieces of code (the code in KTabWidget and the code in QTabWidget) have the same problem: removing and re-inserting into the stackwidget lead to hide(), which leads to focusNextPrevChild, which moves the focus to the unrelated locationbar combobox.
I suggest taking inspiration from the ktabwidget_unittest.cpp testMoveTabs(), and from the fix: http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/widgets/ktabwidget.cpp?r1=1110400&r2=1110399&pathrev=1110400
(ignore the last hunk of that patch).