[Qt-interest] About QWidget::contentsMargins()

Malyushytsky, Alex alex at wai.com
Tue Jun 28 03:27:51 CEST 2011


> 1) widget->contentsMargins() != widget->layout()->contentsMargins() Should
> they not be the same? How are they different from each other?

As far as I understand the difference is that such margins can be used with QWidget derived class without any layout set:

"void QWidget::setContentsMargins ( int left, int top, int right, int bottom )
The margins ... may be used by subclasses to specify the area to draw in (e.g. excluding the frame)."

Regards,
   Alex

-----Original Message-----
From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Kishore
Sent: Monday, June 27, 2011 7:17 AM
To: qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] About QWidget::contentsMargins()

On Saturday 25 Jun 2011 8:59:44 AM Kishore Jonnalagadda wrote:
> I have a couple questions about QWidgets and contents margins.
>
> 1) widget->contentsMargins() != widget->layout()->contentsMargins() Should
> they not be the same? How are they different from each other?
>
> 2) The documentation for QMargins::QMargins() indicates that this default
> constructor creates an object with values obtained from the style in use
> which is typically 11. However, under linux/KDE with the default oxygen
> theme, the defult size used in QMargins in indeed 11 but when i try to read
> qApp->style()->pixelMetric(QStyle::PM_Layout*Margin) it returns 4. Further,
> 4 is also the value shown by designer in its properties view and preview but
> then becomes 11 when used in the final application.
>
> Are these bugs? or do i misunderstand the concepts?

*bump* Can anybody educate me on these topics?
Cheers!
Kishore
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”


More information about the Qt-interest-old mailing list