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?
QtWS25 Last Chance

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 390 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 30 Jan 2024, 08:41 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

    P 1 Reply Last reply 30 Jan 2024, 12:01
    0
    • H Hai Anh Luu
      30 Jan 2024, 08:41

      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

      P Online
      P Online
      Pl45m4
      wrote on 30 Jan 2024, 12:01 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 30 Jan 2024, 17:31
      1
      • P Pl45m4
        30 Jan 2024, 12:01

        @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 30 Jan 2024, 17:31 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

        P 1 Reply Last reply 30 Jan 2024, 17:49
        0
        • H Hai Anh Luu
          30 Jan 2024, 17:31

          @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

          P Online
          P Online
          Pl45m4
          wrote on 30 Jan 2024, 17:49 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 31 Jan 2024, 08:45
          4
          • P Pl45m4
            30 Jan 2024, 17:49

            @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 31 Jan 2024, 08:45 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

            1/5

            30 Jan 2024, 08:41

            • Login

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