QTabWidget: How to get header widget, which contain tab bar and corner widget?
-
wrote on 30 Jan 2024, 08:41 last edited by
-
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!
wrote on 30 Jan 2024, 12:01 last edited by@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 theQTabBar
widget with:and the corner widget with:
-
@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 theQTabBar
widget with:and the corner widget with:
wrote on 30 Jan 2024, 17:31 last edited by@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:
- I setWindowFlags(QtCore.Qt.FramelessWindowHint) and customized a new title bar with Maximum, Minimize and Close buttons.
- 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:
-
@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:
- I setWindowFlags(QtCore.Qt.FramelessWindowHint) and customized a new title bar with Maximum, Minimize and Close buttons.
- 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:
wrote on 30 Jan 2024, 17:49 last edited by@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 toQTabBar
(you can have many tabs there) or it's the background ofQTabWidget
-
@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 toQTabBar
(you can have many tabs there) or it's the background ofQTabWidget
wrote on 31 Jan 2024, 08:45 last edited by@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/5