how to make a QToolbar's "margin" miminum?
-
how to make a QToolbar's "margin" miminum?
because there is only text button on my toolbar, so there is a lot of blank space in the four direction on the toolbar around the buttons.
is there any way to make these blank space smaller?
i tried setSizePolicy, setContentMargin, but seems not work.
thank you -
You can do that with stylesheets, e.g.
QToolBar { padding: 0; } QToolBar QToolButton { padding: 0; margin: 0; }
-
@Chris-Kawa thank you
-
@Chris-Kawa but i use a QWidget to contain 2 QToolBar, on each QToolBar, i include some QAction....
i want the whole QWidget padding, margin equal to 0....how?
thank you -
I'm not sure what you mean but if the toolbars are in a layout then you can do this:
yourWidget->layout()->setContentsMargins(0,0,0,0); yourWidget->layout()->setSpacing(0);
If you mean something else please provide a code sample or an image of what you have and what you want.
-
@Chris-Kawa thank you