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. QTabWidget: How to get header widget, which contain tab bar and corner widget?

QTabWidget: How to get header widget, which contain tab bar and corner widget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 392 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.
  • H Offline
    H Offline
    Hai Anh Luu
    wrote on last edited by
    #1

    As the image I provided, I want to get the widget containing the Tab bar and Corner widget as I have zoned it. Anyone have any ideas? Help me please!

    2ac805fc-7aa3-4cfa-b4a7-a54c40ca11de-image.png

    Pl45m4P 1 Reply Last reply
    0
    • H Hai Anh Luu

      As the image I provided, I want to get the widget containing the Tab bar and Corner widget as I have zoned it. Anyone have any ideas? Help me please!

      2ac805fc-7aa3-4cfa-b4a7-a54c40ca11de-image.png

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Hai-Anh-Luu said in QTabWidget: How to get header widget, which contain tab bar and corner widget?:

      I want to get the widget containing the Tab bar and Corner widget as I have zoned it. Anyone have any ideas? Help me please!

      These are two separate things.
      You can get/set the QTabBar widget with:

      • https://doc.qt.io/qt-6/qtabwidget.html#tabBar

      and the corner widget with:

      • https://doc.qt.io/qt-6/qtabwidget.html#cornerWidget

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      H 1 Reply Last reply
      1
      • Pl45m4P Pl45m4

        @Hai-Anh-Luu said in QTabWidget: How to get header widget, which contain tab bar and corner widget?:

        I want to get the widget containing the Tab bar and Corner widget as I have zoned it. Anyone have any ideas? Help me please!

        These are two separate things.
        You can get/set the QTabBar widget with:

        • https://doc.qt.io/qt-6/qtabwidget.html#tabBar

        and the corner widget with:

        • https://doc.qt.io/qt-6/qtabwidget.html#cornerWidget
        H Offline
        H Offline
        Hai Anh Luu
        wrote on last edited by
        #3

        @Pl45m4 Thank for your answer. But I want to get the free space between QTabBar and Corner widget. Do you have any way to do that? I want to do this because I'm programming an application:

        1. I setWindowFlags(QtCore.Qt.FramelessWindowHint) and customized a new title bar with Maximum, Minimize and Close buttons.
        2. Along with that, I want the widget to contain a QTabBar and Corner widget that can move the window when I drag it. My English is not very good so I will attach an image that I want my QTabWidget to be able to build like that.

        I want my TabWidget like this:

        fcaff348-44e8-4093-b0b1-c65992e30ca8-image.png

        Pl45m4P 1 Reply Last reply
        0
        • H Hai Anh Luu

          @Pl45m4 Thank for your answer. But I want to get the free space between QTabBar and Corner widget. Do you have any way to do that? I want to do this because I'm programming an application:

          1. I setWindowFlags(QtCore.Qt.FramelessWindowHint) and customized a new title bar with Maximum, Minimize and Close buttons.
          2. Along with that, I want the widget to contain a QTabBar and Corner widget that can move the window when I drag it. My English is not very good so I will attach an image that I want my QTabWidget to be able to build like that.

          I want my TabWidget like this:

          fcaff348-44e8-4093-b0b1-c65992e30ca8-image.png

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Hai-Anh-Luu said in QTabWidget: How to get header widget, which contain tab bar and corner widget?:

          But I want to get the free space between QTabBar and Corner widget

          There is no widget there.
          It either belongs to QTabBar (you can have many tabs there) or it's the background of QTabWidget


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          S 1 Reply Last reply
          4
          • Pl45m4P Pl45m4

            @Hai-Anh-Luu said in QTabWidget: How to get header widget, which contain tab bar and corner widget?:

            But I want to get the free space between QTabBar and Corner widget

            There is no widget there.
            It either belongs to QTabBar (you can have many tabs there) or it's the background of QTabWidget

            S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            @Pl45m4 said in QTabWidget: How to get header widget, which contain tab bar and corner widget?:

            It either belongs to QTabBar (you can have many tabs there) or it's the background of QTabWidget

            Implementation hint: override mouseMoveEvent to handle dragging the widget (first checking if you are between the tabs and the corner widgets and checking if the left button is pressed).

            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