Skip to content

PythonQt.QtGui.QLayoutItem · declarations 001

Back to PythonQt.QtGui.QLayoutItem

alignment

alignment() -> Any

X.alignment()

Supplemental documentation: Qt 5 reference:

Qt::Alignment QLayoutItem::alignment() const

Returns the alignment of this item.

See also setAlignment().

Upstream PySide2 reference signatures (binding differences may apply):

alignment(self) -> PySide2.QtCore.Qt.Alignment

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#alignment

controlTypes

controlTypes() -> Any

X.controlTypes()

Supplemental documentation: Qt 5 reference:

[virtual] QSizePolicy::ControlTypes QLayoutItem::controlTypes() const

Returns the control type(s) for the layout item. For a QWidgetItem, the control type comes from the widget's size policy; for a QLayoutItem, the control types is derived from the layout's contents.

See also QSizePolicy::controlType().

Upstream PySide2 reference signatures (binding differences may apply):

controlTypes(self) -> PySide2.QtWidgets.QSizePolicy.ControlTypes

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#controlTypes

expandingDirections

expandingDirections() -> Any

X.expandingDirections()

Supplemental documentation: Qt 5 reference:

[pure virtual] Qt::Orientations QLayoutItem::expandingDirections() const

Returns whether this layout item can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, whereas Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions.

Upstream PySide2 reference signatures (binding differences may apply):

expandingDirections(self) -> PySide2.QtCore.Qt.Orientations

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#expandingDirections

geometry

geometry() -> Any

X.geometry() -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

[pure virtual] QRect QLayoutItem::geometry() const

Returns the rectangle covered by this layout item.

See also setGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

geometry(self) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#geometry

hasHeightForWidth

hasHeightForWidth() -> bool

X.hasHeightForWidth() -> bool

Supplemental documentation: Qt 5 reference:

[virtual] bool QLayoutItem::hasHeightForWidth() const

Returns true if this layout's preferred height depends on its width; otherwise returns false. The default implementation returns false.

Reimplement this function in layout managers that support height for width.

See also heightForWidth() and QWidget::heightForWidth().

Upstream PySide2 reference signatures (binding differences may apply):

hasHeightForWidth(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#hasHeightForWidth

heightForWidth

heightForWidth(arg__1: int) -> int

X.heightForWidth(arg__1) -> int

Supplemental documentation: Qt 5 reference:

[virtual] int QLayoutItem::heightForWidth(int) const

Returns the preferred height for this layout item, given the width, which is not used in this default implementation.

The default implementation returns -1, indicating that the preferred height is independent of the width of the item. Using the function hasHeightForWidth() will typically be much faster than calling this function and testing for -1.

Reimplement this function in layout managers that support height for width. A typical implementation will look like this:

int MyLayout::heightForWidth(int w) const
{
    if (cache_dirty || cached_width != w) {
        MyLayout *that = const_cast<MyLayout *>(this);
        int h = calculateHeightForWidth(w);
        that->cached_hfw = h;
        return h;
    }
    return cached_hfw;
}

Caching is strongly recommended; without it layout will take exponential time.

See also hasHeightForWidth().

Upstream PySide2 reference signatures (binding differences may apply):

heightForWidth(self, arg__1: int) -> int

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#heightForWidth

invalidate

invalidate() -> None

X.invalidate()

Supplemental documentation: Qt 5 reference:

[virtual] void QLayoutItem::invalidate()

Invalidates any cached information in this layout item.

Upstream PySide2 reference signatures (binding differences may apply):

invalidate(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#invalidate

isEmpty

isEmpty() -> bool

X.isEmpty() -> bool

Supplemental documentation: Qt 5 reference:

[pure virtual] bool QLayoutItem::isEmpty() const

Implemented in subclasses to return whether this item is empty, i.e. whether it contains any widgets.

Upstream PySide2 reference signatures (binding differences may apply):

isEmpty(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#isEmpty

layout

layout() -> Any

X.layout() -> PythonQt.QtGui.QLayout

Supplemental documentation: Qt 5 reference:

[virtual] QLayout *QLayoutItem::layout()

If this item is a QLayout, it is returned as a QLayout; otherwise nullptr is returned. This function provides type-safe casting.

See also spacerItem() and widget().

Upstream PySide2 reference signatures (binding differences may apply):

layout(self) -> PySide2.QtWidgets.QLayout

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#layout

maximumSize

maximumSize() -> Any

X.maximumSize() -> PythonQt.QtCore.QSize

Supplemental documentation: Qt 5 reference:

[pure virtual] QSize QLayoutItem::maximumSize() const

Implemented in subclasses to return the maximum size of this item.

Upstream PySide2 reference signatures (binding differences may apply):

maximumSize(self) -> PySide2.QtCore.QSize

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#maximumSize

minimumHeightForWidth

minimumHeightForWidth(arg__1: int) -> int

X.minimumHeightForWidth(arg__1) -> int

Supplemental documentation: Qt 5 reference:

[virtual] int QLayoutItem::minimumHeightForWidth(int w) const

Returns the minimum height this widget needs for the given width, w. The default implementation simply returns heightForWidth(w).

Upstream PySide2 reference signatures (binding differences may apply):

minimumHeightForWidth(self, arg__1: int) -> int

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#minimumHeightForWidth

minimumSize

minimumSize() -> Any

X.minimumSize() -> PythonQt.QtCore.QSize

Supplemental documentation: Qt 5 reference:

[pure virtual] QSize QLayoutItem::minimumSize() const

Implemented in subclasses to return the minimum size of this item.

Upstream PySide2 reference signatures (binding differences may apply):

minimumSize(self) -> PySide2.QtCore.QSize

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#minimumSize

setAlignment

setAlignment(a: Any) -> None

X.setAlignment(a)

Supplemental documentation: Qt 5 reference:

void QLayoutItem::setAlignment(Qt::Alignment alignment)

Sets the alignment of this item to alignment.

Note: Item alignment is only supported by QLayoutItem subclasses where it would have a visual effect. Except for QSpacerItem, which provides blank space for layouts, all public Qt classes that inherit QLayoutItem support item alignment.

See also alignment().

Upstream PySide2 reference signatures (binding differences may apply):

setAlignment(self, a: PySide2.QtCore.Qt.Alignment) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#setAlignment

setGeometry

setGeometry(arg__1: Any) -> None

X.setGeometry(arg__1)

Supplemental documentation: Qt 5 reference:

[pure virtual] void QLayoutItem::setGeometry(const QRect \&r)

Implemented in subclasses to set this item's geometry to r.

See also geometry().

Upstream PySide2 reference signatures (binding differences may apply):

setGeometry(self, arg__1: PySide2.QtCore.QRect) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#setGeometry

sizeHint

sizeHint() -> Any

X.sizeHint() -> PythonQt.QtCore.QSize

Supplemental documentation: Qt 5 reference:

[pure virtual] QSize QLayoutItem::sizeHint() const

Implemented in subclasses to return the preferred size of this item.

Upstream PySide2 reference signatures (binding differences may apply):

sizeHint(self) -> PySide2.QtCore.QSize

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#sizeHint

spacerItem

spacerItem() -> Any

X.spacerItem() -> PythonQt.QtGui.QSpacerItem

Supplemental documentation: Qt 5 reference:

[virtual] QSpacerItem *QLayoutItem::spacerItem()

If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise nullptr is returned. This function provides type-safe casting.

See also layout() and widget().

Upstream PySide2 reference signatures (binding differences may apply):

spacerItem(self) -> PySide2.QtWidgets.QSpacerItem

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#spacerItem

widget

widget() -> Any

X.widget() -> PythonQt.QtGui.QWidget

Supplemental documentation: Qt 5 reference:

[virtual] QWidget *QLayoutItem::widget()

If this item manages a QWidget, returns that widget. Otherwise, nullptr is returned.

Note: While the functions layout() and spacerItem() perform casts, this function returns another object: QLayout and QSpacerItem inherit QLayoutItem, while QWidget does not.

See also layout() and spacerItem().

Upstream PySide2 reference signatures (binding differences may apply):

widget(self) -> PySide2.QtWidgets.QWidget

Source: https://doc.qt.io/archives/qt-5.15/qlayoutitem.html#widget