Skip to content

PythonQt.QtGui.QGraphicsLayoutItem · declarations 001

Back to PythonQt.QtGui.QGraphicsLayoutItem

contentsRect

contentsRect() -> Any

X.contentsRect() -> PythonQt.QtCore.QRectF

Supplemental documentation: Qt 5 reference:

QRectF QGraphicsLayoutItem::contentsRect() const

Returns the contents rect in local coordinates.

The contents rect defines the subrectangle used by an associated layout when arranging subitems. This function is a convenience function that adjusts the item's geometry() by its contents margins. Note that getContentsMargins() is a virtual function that you can reimplement to return the item's contents margins.

See also getContentsMargins() and geometry().

Upstream PySide2 reference signatures (binding differences may apply):

contentsRect(self) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#contentsRect

effectiveSizeHint

effectiveSizeHint(which: Any, constraint: Any) -> Any

X.effectiveSizeHint(which, constraint) -> PythonQt.QtCore.QSizeF

Supplemental documentation: Qt 5 reference:

QSizeF QGraphicsLayoutItem::effectiveSizeHint(Qt::SizeHint which, const QSizeF \&constraint \= QSizeF()) const

Returns the effective size hint for this QGraphicsLayoutItem.

which is the size hint in question. constraint is an optional argument that defines a special constrain when calculating the effective size hint. By default, constraint is QSizeF(-1, -1), which means there is no constraint to the size hint.

If you want to specify the widget's size hint for a given width or height, you can provide the fixed dimension in constraint. This is useful for widgets that can grow only either vertically or horizontally, and need to set either their width or their height to a special value.

For example, a text paragraph item fit into a column width of 200 may grow vertically. You can pass QSizeF(200, -1) as a constraint to get a suitable minimum, preferred and maximum height).

You can adjust the effective size hint by reimplementing sizeHint() in a QGraphicsLayoutItem subclass, or by calling one of the following functions: setMinimumSize(), setPreferredSize, or setMaximumSize() (or a combination of both).

This function caches each of the size hints and guarantees that sizeHint() will be called only once for each value of which - unless constraint is not specified and updateGeometry() has been called.

See also sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

effectiveSizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF=...) -> PySide2.QtCore.QSizeF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#effectiveSizeHint

geometry

geometry() -> Any

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

Supplemental documentation: Qt 5 reference:

QRectF QGraphicsLayoutItem::geometry() const

Returns the item's geometry (e.g., position and size) as a QRectF. This function is equivalent to QRectF(pos(), size()).

See also setGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

geometry(self) -> PySide2.QtCore.QRectF

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

getContentsMargins

getContentsMargins(left: Any, top: Any, right: Any, bottom: Any) -> Any

X.getContentsMargins(left, top, right, bottom)

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsLayoutItem::getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const

This virtual function provides the left, top, right and bottom contents margins for this QGraphicsLayoutItem. The default implementation assumes all contents margins are 0. The parameters point to values stored in qreals. If any of the pointers is nullptr, that value will not be updated.

See also QGraphicsWidget::setContentsMargins().

Upstream PySide2 reference signatures (binding differences may apply):

getContentsMargins(self) -> typing.Tuple[float, float, float, float]

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#getContentsMargins

graphicsItem

graphicsItem() -> Any

X.graphicsItem() -> PythonQt.QtGui.QGraphicsItem

Supplemental documentation: Qt 5 reference:

QGraphicsItem *QGraphicsLayoutItem::graphicsItem() const

Returns the QGraphicsItem that this layout item represents. For QGraphicsWidget it will return itself. For custom items it can return an aggregated value.

See also setGraphicsItem().

Upstream PySide2 reference signatures (binding differences may apply):

graphicsItem(self) -> PySide2.QtWidgets.QGraphicsItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#graphicsItem

isLayout

isLayout() -> bool

X.isLayout() -> bool

Supplemental documentation: Qt 5 reference:

bool QGraphicsLayoutItem::isLayout() const

Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges other QGraphicsLayoutItem objects); otherwise returns false.

See also QGraphicsLayout.

Upstream PySide2 reference signatures (binding differences may apply):

isLayout(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#isLayout

maximumHeight

maximumHeight() -> float

X.maximumHeight() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::maximumHeight() const

Returns the maximum height.

See also setMaximumHeight(), setMaximumSize(), and maximumSize().

Upstream PySide2 reference signatures (binding differences may apply):

maximumHeight(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#maximumHeight

maximumSize

maximumSize() -> Any

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

Supplemental documentation: Qt 5 reference:

QSizeF QGraphicsLayoutItem::maximumSize() const

Returns the maximum size.

See also setMaximumSize(), minimumSize(), preferredSize(), Qt::MaximumSize, and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

maximumSize(self) -> PySide2.QtCore.QSizeF

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

maximumWidth

maximumWidth() -> float

X.maximumWidth() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::maximumWidth() const

Returns the maximum width.

See also setMaximumWidth(), setMaximumSize(), and maximumSize().

Upstream PySide2 reference signatures (binding differences may apply):

maximumWidth(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#maximumWidth

minimumHeight

minimumHeight() -> float

X.minimumHeight() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::minimumHeight() const

Returns the minimum height.

See also setMinimumHeight(), setMinimumSize(), and minimumSize().

Upstream PySide2 reference signatures (binding differences may apply):

minimumHeight(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#minimumHeight

minimumSize

minimumSize() -> Any

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

Supplemental documentation: Qt 5 reference:

QSizeF QGraphicsLayoutItem::minimumSize() const

Returns the minimum size.

See also setMinimumSize(), preferredSize(), maximumSize(), Qt::MinimumSize, and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

minimumSize(self) -> PySide2.QtCore.QSizeF

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

minimumWidth

minimumWidth() -> float

X.minimumWidth() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::minimumWidth() const

Returns the minimum width.

See also setMinimumWidth(), setMinimumSize(), and minimumSize().

Upstream PySide2 reference signatures (binding differences may apply):

minimumWidth(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#minimumWidth

ownedByLayout

ownedByLayout() -> bool

X.ownedByLayout() -> bool

Supplemental documentation: Qt 5 reference:

bool QGraphicsLayoutItem::ownedByLayout() const

Returns whether a layout should delete this item in its destructor. If its true, then the layout will delete it. If its false, then it is assumed that another object has the ownership of it, and the layout won't delete this item.

If the item inherits both QGraphicsItem and QGraphicsLayoutItem (such as QGraphicsWidget does) the item is really part of two ownership hierarchies. This property informs what the layout should do with its child items when it is destructed. In the case of QGraphicsWidget, it is preferred that when the layout is deleted it won't delete its children (since they are also part of the graphics item hierarchy).

By default this value is initialized to false in QGraphicsLayoutItem, but it is overridden by QGraphicsLayout to return true. This is because QGraphicsLayout is not normally part of the QGraphicsItem hierarchy, so the parent layout should delete it. Subclasses might override this default behaviour by calling setOwnedByLayout(true).

This function was introduced in Qt 4.6.

See also setOwnedByLayout().

Upstream PySide2 reference signatures (binding differences may apply):

ownedByLayout(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#ownedByLayout

parentLayoutItem

parentLayoutItem() -> Any

X.parentLayoutItem() -> PythonQt.QtGui.QGraphicsLayoutItem

Supplemental documentation: Qt 5 reference:

QGraphicsLayoutItem *QGraphicsLayoutItem::parentLayoutItem() const

Returns the parent of this QGraphicsLayoutItem, or nullptr if there is no parent, or if the parent does not inherit from QGraphicsLayoutItem (QGraphicsLayoutItem is often used through multiple inheritance with QObject-derived classes).

See also setParentLayoutItem().

Upstream PySide2 reference signatures (binding differences may apply):

parentLayoutItem(self) -> PySide2.QtWidgets.QGraphicsLayoutItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#parentLayoutItem

preferredHeight

preferredHeight() -> float

X.preferredHeight() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::preferredHeight() const

Returns the preferred height.

See also setPreferredHeight(), setPreferredSize(), and preferredSize().

Upstream PySide2 reference signatures (binding differences may apply):

preferredHeight(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#preferredHeight

preferredSize

preferredSize() -> Any

X.preferredSize() -> PythonQt.QtCore.QSizeF

Supplemental documentation: Qt 5 reference:

QSizeF QGraphicsLayoutItem::preferredSize() const

Returns the preferred size.

See also setPreferredSize(), minimumSize(), maximumSize(), Qt::PreferredSize, and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

preferredSize(self) -> PySide2.QtCore.QSizeF

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#preferredSize

preferredWidth

preferredWidth() -> float

X.preferredWidth() -> float

Supplemental documentation: Qt 5 reference:

qreal QGraphicsLayoutItem::preferredWidth() const

Returns the preferred width.

See also setPreferredWidth(), setPreferredSize(), and preferredSize().

Upstream PySide2 reference signatures (binding differences may apply):

preferredWidth(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#preferredWidth

setGeometry

setGeometry(rect: Any) -> None

X.setGeometry(rect)

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsLayoutItem::setGeometry(const QRectF \&rect)

This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordinates (e.g., the top-left corner of rect is equivalent to the item's position in parent coordinates).

You must reimplement this function in a subclass of QGraphicsLayoutItem to receive geometry updates. The layout will call this function when it does a rearrangement.

If rect is outside of the bounds of minimumSize and maximumSize, it will be adjusted to its closest size so that it is within the legal bounds.

See also geometry().

Upstream PySide2 reference signatures (binding differences may apply):

setGeometry(self, rect: PySide2.QtCore.QRectF) -> None

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

setGraphicsItem

setGraphicsItem(item: Any) -> None

X.setGraphicsItem(item)

Supplemental documentation: Qt 5 reference:

[protected] void QGraphicsLayoutItem::setGraphicsItem(QGraphicsItem *item)

If the QGraphicsLayoutItem represents a QGraphicsItem, and it wants to take advantage of the automatic reparenting capabilities of QGraphicsLayout it should set this value. Note that if you delete item and not delete the layout item, you are responsible of calling setGraphicsItem(nullptr) in order to avoid having a dangling pointer.

See also graphicsItem().

Upstream PySide2 reference signatures (binding differences may apply):

setGraphicsItem(self, item: PySide2.QtWidgets.QGraphicsItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setGraphicsItem

setMaximumHeight

setMaximumHeight(height: float) -> None

X.setMaximumHeight(height)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMaximumHeight(qreal height)

Sets the maximum height to height.

See also maximumHeight(), setMaximumSize(), and maximumSize().

Upstream PySide2 reference signatures (binding differences may apply):

setMaximumHeight(self, height: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMaximumHeight

setMaximumSize

setMaximumSize(w: Any, h: Any) -> None

X.setMaximumSize(w, h)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMaximumSize(const QSizeF \&size)

Sets the maximum size to size. This property overrides sizeHint() for Qt::MaximumSize and ensures that effectiveSizeHint() will never return a size larger than size. In order to unset the maximum size, use an invalid size.

See also maximumSize(), minimumSize(), preferredSize(), Qt::MaximumSize, and sizeHint().

void QGraphicsLayoutItem::setMaximumSize(qreal w, qreal h)

This convenience function is equivalent to calling setMaximumSize(QSizeF(w, h)).

See also maximumSize(), setMinimumSize(), setPreferredSize(), and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

setMaximumSize(self, size: PySide2.QtCore.QSizeF) -> None
setMaximumSize(self, w: float, h: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMaximumSize

setMaximumWidth

setMaximumWidth(width: float) -> None

X.setMaximumWidth(width)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMaximumWidth(qreal width)

Sets the maximum width to width.

See also maximumWidth(), setMaximumSize(), and maximumSize().

Upstream PySide2 reference signatures (binding differences may apply):

setMaximumWidth(self, width: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMaximumWidth

setMinimumHeight

setMinimumHeight(height: float) -> None

X.setMinimumHeight(height)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMinimumHeight(qreal height)

Sets the minimum height to height.

See also minimumHeight(), setMinimumSize(), and minimumSize().

Upstream PySide2 reference signatures (binding differences may apply):

setMinimumHeight(self, height: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMinimumHeight

setMinimumSize

setMinimumSize(w: Any, h: Any) -> None

X.setMinimumSize(w, h)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMinimumSize(const QSizeF \&size)

Sets the minimum size to size. This property overrides sizeHint() for Qt::MinimumSize and ensures that effectiveSizeHint() will never return a size smaller than size. In order to unset the minimum size, use an invalid size.

See also minimumSize(), maximumSize(), preferredSize(), Qt::MinimumSize, sizeHint(), setMinimumWidth(), and setMinimumHeight().

void QGraphicsLayoutItem::setMinimumSize(qreal w, qreal h)

This convenience function is equivalent to calling setMinimumSize(QSizeF(w, h)).

See also minimumSize(), setMaximumSize(), setPreferredSize(), and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

setMinimumSize(self, size: PySide2.QtCore.QSizeF) -> None
setMinimumSize(self, w: float, h: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMinimumSize

setMinimumWidth

setMinimumWidth(width: float) -> None

X.setMinimumWidth(width)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setMinimumWidth(qreal width)

Sets the minimum width to width.

See also minimumWidth(), setMinimumSize(), and minimumSize().

Upstream PySide2 reference signatures (binding differences may apply):

setMinimumWidth(self, width: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setMinimumWidth

setOwnedByLayout

setOwnedByLayout(ownedByLayout: bool) -> None

X.setOwnedByLayout(ownedByLayout)

Supplemental documentation: Qt 5 reference:

[protected] void QGraphicsLayoutItem::setOwnedByLayout(bool ownership)

Sets whether a layout should delete this item in its destructor or not. ownership must be true to in order for the layout to delete it.

This function was introduced in Qt 4.6.

See also ownedByLayout().

Upstream PySide2 reference signatures (binding differences may apply):

setOwnedByLayout(self, ownedByLayout: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setOwnedByLayout

setParentLayoutItem

setParentLayoutItem(parent: Any) -> None

X.setParentLayoutItem(parent)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setParentLayoutItem(QGraphicsLayoutItem *parent)

Sets the parent of this QGraphicsLayoutItem to parent.

See also parentLayoutItem().

Upstream PySide2 reference signatures (binding differences may apply):

setParentLayoutItem(self, parent: PySide2.QtWidgets.QGraphicsLayoutItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setParentLayoutItem

setPreferredHeight

setPreferredHeight(height: float) -> None

X.setPreferredHeight(height)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setPreferredHeight(qreal height)

Sets the preferred height to height.

See also preferredHeight(), preferredWidth(), setPreferredSize(), and preferredSize().

Upstream PySide2 reference signatures (binding differences may apply):

setPreferredHeight(self, height: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setPreferredHeight

setPreferredSize

setPreferredSize(w: Any, h: Any) -> None

X.setPreferredSize(w, h)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setPreferredSize(const QSizeF \&size)

Sets the preferred size to size. This property overrides sizeHint() for Qt::PreferredSize and provides the default value for effectiveSizeHint(). In order to unset the preferred size, use an invalid size.

See also preferredSize(), minimumSize(), maximumSize(), Qt::PreferredSize, and sizeHint().

void QGraphicsLayoutItem::setPreferredSize(qreal w, qreal h)

This convenience function is equivalent to calling setPreferredSize(QSizeF(w, h)).

See also preferredSize(), setMaximumSize(), setMinimumSize(), and sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

setPreferredSize(self, size: PySide2.QtCore.QSizeF) -> None
setPreferredSize(self, w: float, h: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setPreferredSize

setPreferredWidth

setPreferredWidth(width: float) -> None

X.setPreferredWidth(width)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setPreferredWidth(qreal width)

Sets the preferred width to width.

See also preferredWidth(), preferredHeight(), setPreferredSize(), and preferredSize().

Upstream PySide2 reference signatures (binding differences may apply):

setPreferredWidth(self, width: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setPreferredWidth

setSizePolicy

setSizePolicy(hPolicy: Any, vPolicy: Any, controlType: Any) -> None

X.setSizePolicy(hPolicy, vPolicy, controlType)

Supplemental documentation: Qt 5 reference:

void QGraphicsLayoutItem::setSizePolicy(const QSizePolicy \&policy)

Sets the size policy to policy. The size policy describes how the item should grow horizontally and vertically when arranged in a layout.

QGraphicsLayoutItem's default size policy is (QSizePolicy::Fixed, QSizePolicy::Fixed, QSizePolicy::DefaultType), but it is common for subclasses to change the default. For example, QGraphicsWidget defaults to (QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::DefaultType).

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

void QGraphicsLayoutItem::setSizePolicy(QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy, QSizePolicy::ControlType controlType \= QSizePolicy::DefaultType)

This is an overloaded function.

This function is equivalent to calling setSizePolicy(QSizePolicy(hPolicy, vPolicy, controlType)).

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

Upstream PySide2 reference signatures (binding differences may apply):

setSizePolicy(self, hPolicy: PySide2.QtWidgets.QSizePolicy.Policy, vPolicy: PySide2.QtWidgets.QSizePolicy.Policy, controlType: PySide2.QtWidgets.QSizePolicy.ControlType=...) -> None
setSizePolicy(self, policy: PySide2.QtWidgets.QSizePolicy) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#setSizePolicy

sizeHint

sizeHint(which: Any, constraint: Any) -> Any

X.sizeHint(which, constraint) -> PythonQt.QtCore.QSizeF

Supplemental documentation: Qt 5 reference:

[pure virtual protected] QSizeF QGraphicsLayoutItem::sizeHint(Qt::SizeHint which, const QSizeF \&constraint \= QSizeF()) const

This pure virtual function returns the size hint for which of the QGraphicsLayoutItem, using the width or height of constraint to constrain the output.

Reimplement this function in a subclass of QGraphicsLayoutItem to provide the necessary size hints for your items.

See also effectiveSizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF=...) -> PySide2.QtCore.QSizeF

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

sizePolicy

sizePolicy() -> Any

X.sizePolicy() -> PythonQt.QtGui.QSizePolicy

Supplemental documentation: Qt 5 reference:

QSizePolicy QGraphicsLayoutItem::sizePolicy() const

Returns the current size policy.

See also setSizePolicy() and QWidget::sizePolicy().

Upstream PySide2 reference signatures (binding differences may apply):

sizePolicy(self) -> PySide2.QtWidgets.QSizePolicy

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#sizePolicy

updateGeometry

updateGeometry() -> None

X.updateGeometry()

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsLayoutItem::updateGeometry()

This virtual function discards any cached size hint information. You should always call this function if you change the return value of the sizeHint() function. Subclasses must always call the base implementation when reimplementing this function.

See also effectiveSizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

updateGeometry(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayoutitem.html#updateGeometry