[Qt-interest] QDialog with wrong contentsMargins()
Kishore Jonnalagadda
kitts.mailinglists at gmail.com
Fri Aug 26 06:28:36 CEST 2011
In alomost all my QDialog subclasses (using designer), I find that i need to
add this to the constructor.
layout()->setContentsMargins(
style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
style()->pixelMetric(QStyle::PM_LayoutTopMargin),
style()->pixelMetric(QStyle::PM_LayoutRightMargin),
style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
Without that it uses 11 pixels as the margins which is said to be the common
default in the docs but is dependent on the style. Here on my system with the
Oxygen style it should be 4 pixels (which is what is shown in designer when
designing the dialog). However, i have to explicitly set it with the code
above.
11 pixels is a bit too much and looks ugly. While i atleast have the option of
putting the code above for most dialogs, the same i can't do with a QWizard
(layout() return a NULL).
I'd like to know if my understanding is wrong* or if this is indeed a bug in
Qt/Oxygen?
--
Cheers!
Kishore
* The layout system for widgets is quite complex I yet have not a grasp of how
things work.
More information about the Qt-interest-old
mailing list