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. How to capture TabView tabs order change event
QtWS25 Last Chance

How to capture TabView tabs order change event

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 1.5k 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.
  • A Offline
    A Offline
    akaisora
    wrote on last edited by
    #1

    Hello!

    I would to know which signal is emitted when the user drags a tab within a tabview and changes its order.

    Thanks!

    Joel BodenmannJ 1 Reply Last reply
    0
    • A akaisora

      Hello!

      I would to know which signal is emitted when the user drags a tab within a tabview and changes its order.

      Thanks!

      Joel BodenmannJ Offline
      Joel BodenmannJ Offline
      Joel Bodenmann
      wrote on last edited by Joel Bodenmann
      #2

      I'm not exactly sure what a TabView is but as it's a view it has to have a QAbstractItemModel somewhere.
      The QAbstractItemModel provides the signals that you are looking for:

      • QAbstractItemModel::columnsMoved()
      • QAbstractItemModel::rowsMoved()
      • ...

      The documentation lists all the available signals: https://doc.qt.io/qt-5/qabstractitemmodel.html#signals

      Hope that helps.

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      1 Reply Last reply
      0
      • A Offline
        A Offline
        akaisora
        wrote on last edited by
        #3

        Thank you for your reply! It's actually a normal TabWidget, I missed that, as I named the component tabview, sorry about that.
        Is your response still valid for a tabwidget?

        Joel BodenmannJ 1 Reply Last reply
        0
        • A akaisora

          Thank you for your reply! It's actually a normal TabWidget, I missed that, as I named the component tabview, sorry about that.
          Is your response still valid for a tabwidget?

          Joel BodenmannJ Offline
          Joel BodenmannJ Offline
          Joel Bodenmann
          wrote on last edited by
          #4

          The QTabWidget contains a QTabBar that you can retrieve with QTabWidget::tabBar(). The QTabBar has a signal tabMoved(int from, int to) that you can use.
          Therefore, you'd end up with something like this:

          connect(_myTabWidget->tabBar(), SIGNAL(tabMoved(int, int)), this, SLOT( ....
          

          Industrial process automation software: https://simulton.com
          Embedded Graphics & GUI library: https://ugfx.io

          1 Reply Last reply
          1
          • A Offline
            A Offline
            akaisora
            wrote on last edited by
            #5

            Thank you very much! Really appreciate your help :)

            Joel BodenmannJ 1 Reply Last reply
            0
            • A akaisora

              Thank you very much! Really appreciate your help :)

              Joel BodenmannJ Offline
              Joel BodenmannJ Offline
              Joel Bodenmann
              wrote on last edited by
              #6

              You're welcome!

              Please mark this topic as solved if you feel that your problem/question has been solved.
              Guide on that: https://forum.qt.io/topic/62700/hitchhiker-s-visual-guide-to-the-qt-forum

              Industrial process automation software: https://simulton.com
              Embedded Graphics & GUI library: https://ugfx.io

              1 Reply Last reply
              1

              • Login

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