Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Content not refreshed after QTabBar::moveTab()
Forum Update on Monday, May 27th 2025

[SOLVED] Content not refreshed after QTabBar::moveTab()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 712 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    clousque
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clousque
      wrote on last edited by
      #2

      Solved by using QTabWidget::insertTab() instead of QTabBar::moveTab(). It is a misunderstanding of the use of QTabWidget and QTabBar.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved