Qt5 documentation QLayout.getContentsMargins()
-
Hi,
In the doc [1], the method getContentsMargins() of QLayout take four arguments and doesn't return nothing.Is it a bug in the doc ?
If I do:
(PyQt user)
layout = QtWidgets.QGridLayout()
print('Margins:', layout.getContentsMargins())Margins: (9, 9, 9, 9)
-
the method takes pointers (IN parameters):
@
int left,
int top,
int right,
int bottom,
layout->getContentsMargins(&left,&top,&right,&bottom);
qDebug() << left << top << right << bottom; //variables contain margin values
@
the method sets the values on the pointers (if they are not NULL).
So it's not a bug ;)Note: there is also another method which return a QMargins object: QLayout::contentsMargins()
-
Ok, the usage is just different by the language C++ >> Python.
Thanks.
vince
-
ye...seems like the python binding doesn't take arguments for getContentsMargins() and returns a list with 4 elements.