QToolBox and scrollbars taking the extra space ?
-
I am trying to get rid of a
QScrollBar
in aQToolbox
because they (even not visible) take the space hence theQToolButton(s)
do not expand horizontally to the full extent. I have tried to apply the style sheets like:QScrollBar:horizontal { height: 0px; width: 0px; } QScrollBar:vertical { height: 0px; width: 0px; }
Did not help. Is there a way to use the scrollbar(s) space for the QToolButtons ?
-
hi
In win 7. Qt 5.5. setting your stylesheet on the
QToolbox, does remove the scrollbar and allow me to
let the widget go all way to the edge. -
@ddze
Hmm does seem very close to my version.- just notice a gap on the left side of the QToolButton on the provided picture
Yes that is just the layouts "layoutLeftMargin" that default has 9. if u set to 0
its aligned with left side.
maybe u can try my test project and tell me if does the same for you
https://www.dropbox.com/s/19ilrtzsyrsrv97/test.zip?dl=0Maybe you use another layout or something else so it seems to work for me and not for you.
Maybe my sample is not working as u want it to. just looking like it :) - just notice a gap on the left side of the QToolButton on the provided picture
-
@mrjj ,
Thanks so much , your example works fine on my pc too. So it must be something with the layout properties in my project.
Strange, cause I checked all the buttons, and they are expanding with the stretch set above zero to take the extra space.
But it is important for me to know that is workable.
-
@mrjj ,
yes , you were right, the, I needed to LayoutStretch of docket widget to 1,1,1,1,1,1,1 and that has solved the expanding of the buttons. ( I thought the QButton size policy was enough , but a docket widget needed the stretch to expand the buttons).
Thank you so much.