Indentation of QWidgets
-
Is it possible to set the indentation of a QWidget?
E.g. if I've got a checkbox which hides/unhides some widgets, so that I can indent the ones which will be hidden by the checkbox?
I know that I can set the x-coordinate of the widget, but I would like to know if there is something similar to the setIndent() of the QLabel for the other widgets as well? -
No, there is no such thing. It is a bit tricky to get right. I ended up creating my own spacer-widget. It is basically nothing more than a QWidget subclass that uses QStyle::subElementRect() with the QStyle::SE_CheckBoxContents sub element to set the size hint for the widget width.
-
How about using this: http://doc.trolltech.com/latest/qwidget.html#setContentsMargins