How to remove the distance between the QTabBar scroller buttons?
-
Hi!
Please tell me why there is a distance between the QTabBar scroller buttons with a small width of the scroller buttons and how can this be fixed?In this case, I have the following in the style sheet:
QTabBar::scroller { width: 6px; }
At the same time, the whole paradox is that in a pure example there is no distance between the buttons and
I can't understand how this could have gone wrong in my example.
Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is. -
Hi,
With only one stylesheet piece it's pretty hard to know what's going on.
Can you provide a minimal compilable example that shows this issue ?
-
Hi,
With only one stylesheet piece it's pretty hard to know what's going on.
Can you provide a minimal compilable example that shows this issue ?
@SGaist
This is a very large project, so I myself can't understand in which part of the code this can happen. I'm trying to at least understand the reason why this could theoretically happen. This offset appears exactly at the moment when the scroller buttons appear, but I can say for sure that this is not a widget and not a layout. I checked the contents of the tabbar, it contains only the tabs themselves and two QToolButton scroller buttons. -
@SGaist
This is a very large project, so I myself can't understand in which part of the code this can happen. I'm trying to at least understand the reason why this could theoretically happen. This offset appears exactly at the moment when the scroller buttons appear, but I can say for sure that this is not a widget and not a layout. I checked the contents of the tabbar, it contains only the tabs themselves and two QToolButton scroller buttons.@Helge1980
seems like another stylesheet rule's selector is too generic and thus some properties get inherited to those buttons too? -
@Helge1980
seems like another stylesheet rule's selector is too generic and thus some properties get inherited to those buttons too?@raven-worx
It doesn't seem like it, I completely disabled all setStyleSheet() in the code and still the same thing happens. -
Hi!
Please tell me why there is a distance between the QTabBar scroller buttons with a small width of the scroller buttons and how can this be fixed?In this case, I have the following in the style sheet:
QTabBar::scroller { width: 6px; }
At the same time, the whole paradox is that in a pure example there is no distance between the buttons and
I can't understand how this could have gone wrong in my example.
Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is.@Helge1980 said in How to remove the distance between the QTabBar scroller buttons?:
At the same time, the whole paradox is that in a pure example there is no distance between the buttons and
what is a pure example? You mean another Qt application with a also a tabbar in it?
I can't understand how this could have gone wrong in my example.
Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is.These are widgets handled by QTabBar internally.
Btw. its better to set the styleheet globally on the qapplication instance than have multiple setStylesheet calls on each widget.
So you still have something in your code that affects this behavior. Can you take the widget out of its parent widget? So that it appears a separate window. Simply remove the parent widget, the rest of the code shouldn't be affected.