[SOLVED] Content not refreshed after QTabBar::moveTab()
-
Hi,
I have a class that inherits from QTabBar. Tabs in this tab bar may embed a window handler or a qml page. After I have moved a tab from left (index 0 for instance) to right (last index), the content of the moved tab (now at the last index) is in now the content of the tab at index 0 (after the move).
The move is done by QTabBar::moveTab().
@tabbar->moveTab(tabbar->tabAt(m_dragStartPos), tabbar->tabAt (m_dragDropedPos));@So I thinked of a
@setCurrentIndex(tabbar->tabAt (m_dragDropedPos))@but it did not work.
But when I do a removeTab(), addTab() and setCurrentIndex(), the result is good but the tab is always moved at the end of the TabBar.
Thanks for your help
-
Solved by using QTabWidget::insertTab() instead of QTabBar::moveTab(). It is a misunderstanding of the use of QTabWidget and QTabBar.