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 customize the working smoothly QTabWidget to enhance the user experience like Navicat?

How to customize the working smoothly QTabWidget to enhance the user experience like Navicat?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 485 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.
  • crimson1023C Offline
    crimson1023C Offline
    crimson1023
    wrote on last edited by
    #1

    Hello, everyone, I want to create the extend tabwidget like navicat that has dragging and dropping feature to detach and attach.

    To enable the detaching the widget from tabwidget by dragging the tab in tabbar.

    When the dragging the tab in tabbar, if cursor is in the tabbar, tab only is only movable like default tabwidget with setMovable(true).
    58a4873c-5e4a-436b-b721-02c35330e2e8-image.png
    if the cursor is outside of the tabbar, the current widget will be detached and tab will be dissapear.
    And also, widget is dragging and movable freely to change the position.

    ee65bacb-2c2f-4379-a0ea-ebcc5884ca2b-image.png

    To enable the attaching the widget from tabwidget by dragging and dropping into the tabbar.

    By dragging the widget detached from tabwidget to bring closer to the tabbar, If the tabbar region contains the cursor, the widget will be semi-transparent and tab will be appeared and dragging status that enabled to change the order index of the tabbar.

    880977e0-b7df-441e-973a-a2af84d2ccbb-image.png

    And then next by dropping the widget, the widget will be attached.

    35abd95a-254c-413a-aa46-a20bab0f52ff-image.png

    Please help me if you have any idea or have an experience.
    Thank you in advance.

    JonBJ 1 Reply Last reply
    1
    • crimson1023C crimson1023

      Hello, everyone, I want to create the extend tabwidget like navicat that has dragging and dropping feature to detach and attach.

      To enable the detaching the widget from tabwidget by dragging the tab in tabbar.

      When the dragging the tab in tabbar, if cursor is in the tabbar, tab only is only movable like default tabwidget with setMovable(true).
      58a4873c-5e4a-436b-b721-02c35330e2e8-image.png
      if the cursor is outside of the tabbar, the current widget will be detached and tab will be dissapear.
      And also, widget is dragging and movable freely to change the position.

      ee65bacb-2c2f-4379-a0ea-ebcc5884ca2b-image.png

      To enable the attaching the widget from tabwidget by dragging and dropping into the tabbar.

      By dragging the widget detached from tabwidget to bring closer to the tabbar, If the tabbar region contains the cursor, the widget will be semi-transparent and tab will be appeared and dragging status that enabled to change the order index of the tabbar.

      880977e0-b7df-441e-973a-a2af84d2ccbb-image.png

      And then next by dropping the widget, the widget will be attached.

      35abd95a-254c-413a-aa46-a20bab0f52ff-image.png

      Please help me if you have any idea or have an experience.
      Thank you in advance.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @crimson1023
      You have to code this yourself, it does not come with QTabWidget.

      Googling for qtabwidget detach tabs will show you some questions/answers.

      For all I know https://github.com/epasveer/QDetachTabWidget might be what you want, it was at least updated recently. I don't know whether Google searches might reveal better solutions.

      1 Reply Last reply
      0
      • crimson1023C Offline
        crimson1023C Offline
        crimson1023
        wrote on last edited by
        #3

        I have already googled and every open source in github is not smooth and not same as a tabwidget in the navicat.

        When detaching the tab, almost is using QDrag and Qpixmap to implement the detaching and moving the widget, but in the navicat real widget is dragged. And also when attaching the widget can't add the tab that enables to change the order index.

        Have you got any opinion?

        1 Reply Last reply
        0
        • JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          Not other than having to write whatever exact implementation you want, given that others are not to your liking.

          1 Reply Last reply
          0
          • crimson1023C Offline
            crimson1023C Offline
            crimson1023
            wrote on last edited by
            #5

            Yeah, you are right, but I don't know how to implement this so came here to discuss with you.

            1 Reply Last reply
            0
            • crimson1023C Offline
              crimson1023C Offline
              crimson1023
              wrote on last edited by
              #6
              This post is deleted!
              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