Skip to content

PythonQt.QtGui.QGraphicsLayout · declarations 001

Back to PythonQt.QtGui.QGraphicsLayout

activate

activate() -> None

X.activate()

Supplemental documentation: Qt 5 reference:

void QGraphicsLayout::activate()

Activates the layout, causing all items in the layout to be immediately rearranged. This function is based on calling count() and itemAt(), and then calling setGeometry() on all items sequentially. When activated, the layout will adjust its geometry to its parent's contentsRect(). The parent will then invalidate any layout of its own.

If called in sequence or recursively, e.g., by one of the arranged items in response to being resized, this function will do nothing.

Note that the layout is free to use geometry caching to optimize this process. To forcefully invalidate any such cache, you can call invalidate() before calling activate().

See also invalidate().

Upstream PySide2 reference signatures (binding differences may apply):

activate(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#activate

addChildLayoutItem

addChildLayoutItem(layoutItem: Any) -> None

X.addChildLayoutItem(layoutItem)

Supplemental documentation: Qt 5 reference:

[protected] void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem)

This function is a convenience function provided for custom layouts, and will go through all items in the layout and reparent their graphics items to the closest QGraphicsWidget ancestor of the layout.

If layoutItem is already in a different layout, it will be removed from that layout.

If custom layouts want special behaviour they can ignore to use this function, and implement their own behaviour.

This function was introduced in Qt 4.6.

See also graphicsItem().

Upstream PySide2 reference signatures (binding differences may apply):

addChildLayoutItem(self, layoutItem: PySide2.QtWidgets.QGraphicsLayoutItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#addChildLayoutItem

count

count() -> int

X.count() -> int

Supplemental documentation: Qt 5 reference:

[pure virtual] int QGraphicsLayout::count() const

This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return the number of items in the layout.

The subclass is free to decide how to store the items.

See also itemAt() and removeAt().

Upstream PySide2 reference signatures (binding differences may apply):

count(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#count

getContentsMargins

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

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

Supplemental documentation: Qt 5 reference:

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

Reimplements: QGraphicsLayoutItem::getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const.

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/qgraphicslayout.html#getContentsMargins

instantInvalidatePropagation

instantInvalidatePropagation() -> bool

X.instantInvalidatePropagation() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

instantInvalidatePropagation() -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#instantInvalidatePropagation

invalidate

invalidate() -> None

X.invalidate()

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsLayout::invalidate()

Clears any cached geometry and size hint information in the layout, and posts a LayoutRequest event to the managed parent QGraphicsLayoutItem.

See also activate() and setGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

invalidate(self) -> None

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

isActivated

isActivated() -> bool

X.isActivated() -> bool

Supplemental documentation: Qt 5 reference:

bool QGraphicsLayout::isActivated() const

Returns true if the layout is currently being activated; otherwise, returns false. If the layout is being activated, this means that it is currently in the process of rearranging its items (i.e., the activate() function has been called, and has not yet returned).

See also activate() and invalidate().

Upstream PySide2 reference signatures (binding differences may apply):

isActivated(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#isActivated

itemAt

itemAt(i: int) -> Any

X.itemAt(i) -> PythonQt.QtGui.QGraphicsLayoutItem

Supplemental documentation: Qt 5 reference:

[pure virtual] QGraphicsLayoutItem *QGraphicsLayout::itemAt(int i) const

This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return a pointer to the item at index i. The reimplementation can assume that i is valid (i.e., it respects the value of count()). Together with count(), it is provided as a means of iterating over all items in a layout.

The subclass is free to decide how to store the items, and the visual arrangement does not have to be reflected through this function.

See also count() and removeAt().

Upstream PySide2 reference signatures (binding differences may apply):

itemAt(self, i: int) -> PySide2.QtWidgets.QGraphicsLayoutItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#itemAt

removeAt

removeAt(index: int) -> None

X.removeAt(index)

Supplemental documentation: Qt 5 reference:

[pure virtual] void QGraphicsLayout::removeAt(int index)

This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to remove the item at index. The reimplementation can assume that index is valid (i.e., it respects the value of count()).

The implementation must ensure that the parentLayoutItem() of the removed item does not point to this layout, since the item is considered to be removed from the layout hierarchy.

If the layout is to be reused between applications, we recommend that the layout deletes the item, but the graphics view framework does not depend on this.

The subclass is free to decide how to store the items.

See also itemAt() and count().

Upstream PySide2 reference signatures (binding differences may apply):

removeAt(self, index: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#removeAt

setContentsMargins

setContentsMargins(left: float, top: float, right: float, bottom: float) -> None

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

Supplemental documentation: Qt 5 reference:

void QGraphicsLayout::setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)

Sets the contents margins to left, top, right and bottom. The default contents margins for toplevel layouts are style dependent (by querying the pixelMetric for QStyle::PM_LayoutLeftMargin, QStyle::PM_LayoutTopMargin, QStyle::PM_LayoutRightMargin and QStyle::PM_LayoutBottomMargin).

For sublayouts the default margins are 0.

Changing the contents margins automatically invalidates the layout.

See also invalidate().

Upstream PySide2 reference signatures (binding differences may apply):

setContentsMargins(self, left: float, top: float, right: float, bottom: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#setContentsMargins

setGeometry

setGeometry(rect: Any) -> Any

X.setGeometry(rect)

setInstantInvalidatePropagation

setInstantInvalidatePropagation(enable: bool) -> None

X.setInstantInvalidatePropagation(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setInstantInvalidatePropagation(enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#setInstantInvalidatePropagation

sizeHint

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

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

updateGeometry

updateGeometry() -> None

X.updateGeometry()

Supplemental documentation: Qt 5 reference:

[override virtual] void QGraphicsLayout::updateGeometry()

Reimplements: QGraphicsLayoutItem::updateGeometry().

Upstream PySide2 reference signatures (binding differences may apply):

updateGeometry(self) -> None

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

widgetEvent

widgetEvent(e: Any) -> None

X.widgetEvent(e)

Supplemental documentation: Qt 5 reference:

[virtual] void QGraphicsLayout::widgetEvent(QEvent *e)

This virtual event handler receives all events for the managed widget. QGraphicsLayout uses this event handler to listen for layout related events such as geometry changes, layout changes or layout direction changes.

e is a pointer to the event.

You can reimplement this event handler to track similar events for your own custom layout.

See also QGraphicsWidget::event() and QGraphicsItem::sceneEvent().

Upstream PySide2 reference signatures (binding differences may apply):

widgetEvent(self, e: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicslayout.html#widgetEvent