Change the size of the Tab Widget icon
-
It is possible to change the icon size of a Tab Widget.
I don't think you need the code to answer me. But if ever I will give it to you.
Thanks for your help
@Raphawel
AQTabWidget
has aQTabBar
where those tabs/text are placed. That is what you need to affect. Example using stylesheet:// tabWidget is a pointer to a QTabWidget tabWidget->setStyleSheet("QTabBar::tab { height: 100px; width: 100px; }"); // each tab should now be 100x100px
Though you ask about "icon size", but show no icons.... There is also
QTabWidget::setIconSize(const QSize &size)
. -
@Raphawel
AQTabWidget
has aQTabBar
where those tabs/text are placed. That is what you need to affect. Example using stylesheet:// tabWidget is a pointer to a QTabWidget tabWidget->setStyleSheet("QTabBar::tab { height: 100px; width: 100px; }"); // each tab should now be 100x100px
Though you ask about "icon size", but show no icons.... There is also
QTabWidget::setIconSize(const QSize &size)
.@JonB said in Change the size of the Tab Widget icon:
QTabBar::tab { height: 100px; width: 100px; }");
The order you tell me to make does not change anything. So I don't know if I'm writing it down correctly.
In my case if I want to change the size of the "Control" icon, it is declared as "control_tab" in my QWidget.So according to what I wrote I put:
ui->control_tab->setStyleSheet("QTabBar::control_tab { height: 100px; widht: 100px; }");
-
@JonB said in Change the size of the Tab Widget icon:
QTabBar::tab { height: 100px; width: 100px; }");
The order you tell me to make does not change anything. So I don't know if I'm writing it down correctly.
In my case if I want to change the size of the "Control" icon, it is declared as "control_tab" in my QWidget.So according to what I wrote I put:
ui->control_tab->setStyleSheet("QTabBar::control_tab { height: 100px; widht: 100px; }");
@Raphawel
Why don't you start by clarifying why you are asking about an icon size, given that you don't show any icons, while there is aQTabWidget::setIconSize()
method. And you quote the line which sets the tab size, no reference to icon. We are not mind-readers, so don't know what you actually want to affect.the size of the "Control" icon, it is declared as "control_tab" in my QWidget
What "Control" icon??
QTabBar::control_tab { ...
. This is simply wrong. You can only write::tab
there. -
@Raphawel
Why don't you start by clarifying why you are asking about an icon size, given that you don't show any icons, while there is aQTabWidget::setIconSize()
method. And you quote the line which sets the tab size, no reference to icon. We are not mind-readers, so don't know what you actually want to affect.the size of the "Control" icon, it is declared as "control_tab" in my QWidget
What "Control" icon??
QTabBar::control_tab { ...
. This is simply wrong. You can only write::tab
there.Look at the pictures, I want the Control icon that I circled in red to take up less space. I have already tried to change the iconsize, in the settings but nothing changes
When I run the .exe the Control tab that I circled in red again takes up space. I want to reduce this size just for aesthetics, that's all.
I can't do more simple to explain my problem, sorry.
So I need QTabWidget::setIconSize but why when I change the size of the Control tab in the settings nothing changes?
-
Look at the pictures, I want the Control icon that I circled in red to take up less space. I have already tried to change the iconsize, in the settings but nothing changes
When I run the .exe the Control tab that I circled in red again takes up space. I want to reduce this size just for aesthetics, that's all.
I can't do more simple to explain my problem, sorry.
So I need QTabWidget::setIconSize but why when I change the size of the Control tab in the settings nothing changes?
@Raphawel said in Change the size of the Tab Widget icon:
I can't do more simple to explain my problem, sorry.
Look at the pictures, I want the Control icon that I circled in red
I see no icon, neither on the Control tab nor elsewhere. What is circled in red is not an icon.
I leave someone else to try to understand what you are asking. -
Look at the pictures, I want the Control icon that I circled in red to take up less space. I have already tried to change the iconsize, in the settings but nothing changes
When I run the .exe the Control tab that I circled in red again takes up space. I want to reduce this size just for aesthetics, that's all.
I can't do more simple to explain my problem, sorry.
So I need QTabWidget::setIconSize but why when I change the size of the Control tab in the settings nothing changes?
-
@Raphawel
AQTabWidget
has aQTabBar
where those tabs/text are placed. That is what you need to affect. Example using stylesheet:// tabWidget is a pointer to a QTabWidget tabWidget->setStyleSheet("QTabBar::tab { height: 100px; width: 100px; }"); // each tab should now be 100x100px
Though you ask about "icon size", but show no icons.... There is also
QTabWidget::setIconSize(const QSize &size)
. -
@Raphawel
Previously answered:
@JonB said in Change the size of the Tab Widget icon:// tabWidget is a pointer to a QTabWidget
tabWidget->setStyleSheet("QTabBar::tab { height: 100px; width: 100px; }");
// each tab should now be 100x100px -