[][src]Struct qt_widgets::QGraphicsGridLayout

#[repr(C)]pub struct QGraphicsGridLayout { /* fields omitted */ }

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.

C++ class: QGraphicsGridLayout.

C++ documentation:

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.

The most common way to use QGraphicsGridLayout is to construct an object on the heap with no parent, add widgets and layouts by calling addItem(), and finally assign the layout to a widget by calling QGraphicsWidget::setLayout(). QGraphicsGridLayout automatically computes the dimensions of the grid as you add items.

QGraphicsScene scene; QGraphicsWidget textEdit = scene.addWidget(new QTextEdit); QGraphicsWidget pushButton = scene.addWidget(new QPushButton);

QGraphicsGridLayout *layout = new QGraphicsGridLayout; layout->addItem(textEdit, 0, 0); layout->addItem(pushButton, 0, 1);

QGraphicsWidget *form = new QGraphicsWidget; form->setLayout(layout); scene.addItem(form);

The layout takes ownership of the items. In some cases when the layout item also inherits from QGraphicsItem (such as QGraphicsWidget) there will be a ambiguity in ownership because the layout item belongs to two ownership hierarchies. See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle this. You can access each item in the layout by calling count() and itemAt(). Calling removeAt() will remove an item from the layout, without destroying it.

Methods

impl QGraphicsGridLayout[src]

pub unsafe fn add_item_6a(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
    row: c_int,
    column: c_int,
    row_span: c_int,
    column_span: c_int,
    alignment: QFlags<AlignmentFlag>
)
[src]

Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.

Calls C++ function: void QGraphicsGridLayout::addItem(QGraphicsLayoutItem* item, int row, int column, int rowSpan, int columnSpan, QFlags<Qt::AlignmentFlag> alignment = …).

C++ documentation:

Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.

pub unsafe fn add_item_4a(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
    row: c_int,
    column: c_int,
    alignment: QFlags<AlignmentFlag>
)
[src]

Adds item to the grid on row and column. You can specify an optional alignment for item.

Calls C++ function: void QGraphicsGridLayout::addItem(QGraphicsLayoutItem* item, int row, int column, QFlags<Qt::AlignmentFlag> alignment = …).

C++ documentation:

Adds item to the grid on row and column. You can specify an optional alignment for item.

pub unsafe fn add_item_5a(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
    row: c_int,
    column: c_int,
    row_span: c_int,
    column_span: c_int
)
[src]

Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.

Calls C++ function: void QGraphicsGridLayout::addItem(QGraphicsLayoutItem* item, int row, int column, int rowSpan, int columnSpan).

C++ documentation:

Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.

pub unsafe fn add_item_3a(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
    row: c_int,
    column: c_int
)
[src]

Adds item to the grid on row and column. You can specify an optional alignment for item.

Calls C++ function: void QGraphicsGridLayout::addItem(QGraphicsLayoutItem* item, int row, int column).

C++ documentation:

Adds item to the grid on row and column. You can specify an optional alignment for item.

pub unsafe fn alignment(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>
) -> QFlags<AlignmentFlag>
[src]

Returns the alignment for item.

Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::alignment(QGraphicsLayoutItem* item) const.

C++ documentation:

Returns the alignment for item.

See also setAlignment().

pub unsafe fn column_alignment(&self, column: c_int) -> QFlags<AlignmentFlag>[src]

Returns the alignment for column.

Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::columnAlignment(int column) const.

C++ documentation:

Returns the alignment for column.

See also setColumnAlignment().

pub unsafe fn column_count(&self) -> c_int[src]

Returns the number of columns in the grid layout. This is always one more than the index of the last column that is occupied by a layout item (empty columns are counted except for those at the end).

Calls C++ function: int QGraphicsGridLayout::columnCount() const.

C++ documentation:

Returns the number of columns in the grid layout. This is always one more than the index of the last column that is occupied by a layout item (empty columns are counted except for those at the end).

pub unsafe fn column_maximum_width(&self, column: c_int) -> c_double[src]

Returns the maximum width for column.

Calls C++ function: double QGraphicsGridLayout::columnMaximumWidth(int column) const.

C++ documentation:

Returns the maximum width for column.

See also setColumnMaximumWidth().

pub unsafe fn column_minimum_width(&self, column: c_int) -> c_double[src]

Returns the minimum width for column.

Calls C++ function: double QGraphicsGridLayout::columnMinimumWidth(int column) const.

C++ documentation:

Returns the minimum width for column.

See also setColumnMinimumWidth().

pub unsafe fn column_preferred_width(&self, column: c_int) -> c_double[src]

Returns the preferred width for column.

Calls C++ function: double QGraphicsGridLayout::columnPreferredWidth(int column) const.

C++ documentation:

Returns the preferred width for column.

See also setColumnPreferredWidth().

pub unsafe fn column_spacing(&self, column: c_int) -> c_double[src]

Returns the column spacing for column.

Calls C++ function: double QGraphicsGridLayout::columnSpacing(int column) const.

C++ documentation:

Returns the column spacing for column.

See also setColumnSpacing().

pub unsafe fn column_stretch_factor(&self, column: c_int) -> c_int[src]

Returns the stretch factor for column.

Calls C++ function: int QGraphicsGridLayout::columnStretchFactor(int column) const.

C++ documentation:

Returns the stretch factor for column.

See also setColumnStretchFactor().

pub unsafe fn count(&self) -> c_int[src]

Reimplemented from QGraphicsLayout::count().

Calls C++ function: virtual int QGraphicsGridLayout::count() const.

C++ documentation:

Reimplemented from QGraphicsLayout::count().

Returns the number of layout items in this grid layout.

pub unsafe fn horizontal_spacing(&self) -> c_double[src]

Returns the default horizontal spacing for the grid layout.

Calls C++ function: double QGraphicsGridLayout::horizontalSpacing() const.

C++ documentation:

Returns the default horizontal spacing for the grid layout.

See also setHorizontalSpacing().

pub unsafe fn invalidate(&self)[src]

Reimplemented from QGraphicsLayout::invalidate().

Calls C++ function: virtual void QGraphicsGridLayout::invalidate().

C++ documentation:

Reimplemented from QGraphicsLayout::invalidate().

pub unsafe fn item_at_2a(
    &self,
    row: c_int,
    column: c_int
) -> Ptr<QGraphicsLayoutItem>
[src]

Returns a pointer to the layout item at (row, column).

Calls C++ function: QGraphicsLayoutItem* QGraphicsGridLayout::itemAt(int row, int column) const.

C++ documentation:

Returns a pointer to the layout item at (row, column).

pub unsafe fn item_at_1a(&self, index: c_int) -> Ptr<QGraphicsLayoutItem>[src]

Reimplemented from QGraphicsLayout::itemAt().

Calls C++ function: virtual QGraphicsLayoutItem* QGraphicsGridLayout::itemAt(int index) const.

C++ documentation:

Reimplemented from QGraphicsLayout::itemAt().

Returns the layout item at index, or 0 if there is no layout item at this index.

pub unsafe fn new_1a(
    parent: impl CastInto<Ptr<QGraphicsLayoutItem>>
) -> CppBox<QGraphicsGridLayout>
[src]

Constructs a QGraphicsGridLayout instance. parent is passed to QGraphicsLayout's constructor.

Calls C++ function: [constructor] void QGraphicsGridLayout::QGraphicsGridLayout(QGraphicsLayoutItem* parent = …).

C++ documentation:

Constructs a QGraphicsGridLayout instance. parent is passed to QGraphicsLayout's constructor.

pub unsafe fn new_0a() -> CppBox<QGraphicsGridLayout>[src]

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.

Calls C++ function: [constructor] void QGraphicsGridLayout::QGraphicsGridLayout().

C++ documentation:

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.

The most common way to use QGraphicsGridLayout is to construct an object on the heap with no parent, add widgets and layouts by calling addItem(), and finally assign the layout to a widget by calling QGraphicsWidget::setLayout(). QGraphicsGridLayout automatically computes the dimensions of the grid as you add items.

QGraphicsScene scene; QGraphicsWidget textEdit = scene.addWidget(new QTextEdit); QGraphicsWidget pushButton = scene.addWidget(new QPushButton);

QGraphicsGridLayout *layout = new QGraphicsGridLayout; layout->addItem(textEdit, 0, 0); layout->addItem(pushButton, 0, 1);

QGraphicsWidget *form = new QGraphicsWidget; form->setLayout(layout); scene.addItem(form);

The layout takes ownership of the items. In some cases when the layout item also inherits from QGraphicsItem (such as QGraphicsWidget) there will be a ambiguity in ownership because the layout item belongs to two ownership hierarchies. See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle this. You can access each item in the layout by calling count() and itemAt(). Calling removeAt() will remove an item from the layout, without destroying it.

pub unsafe fn remove_at(&self, index: c_int)[src]

Reimplemented from QGraphicsLayout::removeAt().

Calls C++ function: virtual void QGraphicsGridLayout::removeAt(int index).

C++ documentation:

Reimplemented from QGraphicsLayout::removeAt().

Removes the layout item at index without destroying it. Ownership of the item is transferred to the caller.

See also addItem().

pub unsafe fn remove_item(&self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>)[src]

Removes the layout item item without destroying it. Ownership of the item is transferred to the caller.

Calls C++ function: void QGraphicsGridLayout::removeItem(QGraphicsLayoutItem* item).

C++ documentation:

Removes the layout item item without destroying it. Ownership of the item is transferred to the caller.

See also addItem().

pub unsafe fn row_alignment(&self, row: c_int) -> QFlags<AlignmentFlag>[src]

Returns the alignment of row.

Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::rowAlignment(int row) const.

C++ documentation:

Returns the alignment of row.

See also setRowAlignment().

pub unsafe fn row_count(&self) -> c_int[src]

Returns the number of rows in the grid layout. This is always one more than the index of the last row that is occupied by a layout item (empty rows are counted except for those at the end).

Calls C++ function: int QGraphicsGridLayout::rowCount() const.

C++ documentation:

Returns the number of rows in the grid layout. This is always one more than the index of the last row that is occupied by a layout item (empty rows are counted except for those at the end).

pub unsafe fn row_maximum_height(&self, row: c_int) -> c_double[src]

Returns the maximum height for row, row.

Calls C++ function: double QGraphicsGridLayout::rowMaximumHeight(int row) const.

C++ documentation:

Returns the maximum height for row, row.

See also setRowMaximumHeight().

pub unsafe fn row_minimum_height(&self, row: c_int) -> c_double[src]

Returns the minimum height for row, row.

Calls C++ function: double QGraphicsGridLayout::rowMinimumHeight(int row) const.

C++ documentation:

Returns the minimum height for row, row.

See also setRowMinimumHeight().

pub unsafe fn row_preferred_height(&self, row: c_int) -> c_double[src]

Returns the preferred height for row, row.

Calls C++ function: double QGraphicsGridLayout::rowPreferredHeight(int row) const.

C++ documentation:

Returns the preferred height for row, row.

See also setRowPreferredHeight().

pub unsafe fn row_spacing(&self, row: c_int) -> c_double[src]

Returns the row spacing for row.

Calls C++ function: double QGraphicsGridLayout::rowSpacing(int row) const.

C++ documentation:

Returns the row spacing for row.

See also setRowSpacing().

pub unsafe fn row_stretch_factor(&self, row: c_int) -> c_int[src]

Returns the stretch factor for row.

Calls C++ function: int QGraphicsGridLayout::rowStretchFactor(int row) const.

C++ documentation:

Returns the stretch factor for row.

See also setRowStretchFactor().

pub unsafe fn set_alignment(
    &self,
    item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
    alignment: QFlags<AlignmentFlag>
)
[src]

Sets the alignment for item to alignment.

Calls C++ function: void QGraphicsGridLayout::setAlignment(QGraphicsLayoutItem* item, QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Sets the alignment for item to alignment.

See also alignment().

pub unsafe fn set_column_alignment(
    &self,
    column: c_int,
    alignment: QFlags<AlignmentFlag>
)
[src]

Sets the alignment for column to alignment.

Calls C++ function: void QGraphicsGridLayout::setColumnAlignment(int column, QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Sets the alignment for column to alignment.

See also columnAlignment().

pub unsafe fn set_column_fixed_width(&self, column: c_int, width: c_double)[src]

Sets the fixed width of column to width.

Calls C++ function: void QGraphicsGridLayout::setColumnFixedWidth(int column, double width).

C++ documentation:

Sets the fixed width of column to width.

pub unsafe fn set_column_maximum_width(&self, column: c_int, width: c_double)[src]

Sets the maximum width of column to width.

Calls C++ function: void QGraphicsGridLayout::setColumnMaximumWidth(int column, double width).

C++ documentation:

Sets the maximum width of column to width.

See also columnMaximumWidth().

pub unsafe fn set_column_minimum_width(&self, column: c_int, width: c_double)[src]

Sets the minimum width for column to width.

Calls C++ function: void QGraphicsGridLayout::setColumnMinimumWidth(int column, double width).

C++ documentation:

Sets the minimum width for column to width.

See also columnMinimumWidth().

pub unsafe fn set_column_preferred_width(&self, column: c_int, width: c_double)[src]

Sets the preferred width for column to width.

Calls C++ function: void QGraphicsGridLayout::setColumnPreferredWidth(int column, double width).

C++ documentation:

Sets the preferred width for column to width.

See also columnPreferredWidth().

pub unsafe fn set_column_spacing(&self, column: c_int, spacing: c_double)[src]

Sets the spacing for column to spacing.

Calls C++ function: void QGraphicsGridLayout::setColumnSpacing(int column, double spacing).

C++ documentation:

Sets the spacing for column to spacing.

See also columnSpacing().

pub unsafe fn set_column_stretch_factor(&self, column: c_int, stretch: c_int)[src]

Sets the stretch factor for column to stretch.

Calls C++ function: void QGraphicsGridLayout::setColumnStretchFactor(int column, int stretch).

C++ documentation:

Sets the stretch factor for column to stretch.

See also columnStretchFactor().

pub unsafe fn set_geometry(&self, rect: impl CastInto<Ref<QRectF>>)[src]

Reimplemented from QGraphicsLayoutItem::setGeometry().

Calls C++ function: virtual void QGraphicsGridLayout::setGeometry(const QRectF& rect).

C++ documentation:

Reimplemented from QGraphicsLayoutItem::setGeometry().

Sets the bounding geometry of the grid layout to rect.

pub unsafe fn set_horizontal_spacing(&self, spacing: c_double)[src]

Sets the default horizontal spacing for the grid layout to spacing.

Calls C++ function: void QGraphicsGridLayout::setHorizontalSpacing(double spacing).

C++ documentation:

Sets the default horizontal spacing for the grid layout to spacing.

See also horizontalSpacing().

pub unsafe fn set_row_alignment(
    &self,
    row: c_int,
    alignment: QFlags<AlignmentFlag>
)
[src]

Sets the alignment of row to alignment.

Calls C++ function: void QGraphicsGridLayout::setRowAlignment(int row, QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Sets the alignment of row to alignment.

See also rowAlignment().

pub unsafe fn set_row_fixed_height(&self, row: c_int, height: c_double)[src]

Sets the fixed height for row, row, to height.

Calls C++ function: void QGraphicsGridLayout::setRowFixedHeight(int row, double height).

C++ documentation:

Sets the fixed height for row, row, to height.

pub unsafe fn set_row_maximum_height(&self, row: c_int, height: c_double)[src]

Sets the maximum height for row, row, to height.

Calls C++ function: void QGraphicsGridLayout::setRowMaximumHeight(int row, double height).

C++ documentation:

Sets the maximum height for row, row, to height.

See also rowMaximumHeight().

pub unsafe fn set_row_minimum_height(&self, row: c_int, height: c_double)[src]

Sets the minimum height for row, row, to height.

Calls C++ function: void QGraphicsGridLayout::setRowMinimumHeight(int row, double height).

C++ documentation:

Sets the minimum height for row, row, to height.

See also rowMinimumHeight().

pub unsafe fn set_row_preferred_height(&self, row: c_int, height: c_double)[src]

Sets the preferred height for row, row, to height.

Calls C++ function: void QGraphicsGridLayout::setRowPreferredHeight(int row, double height).

C++ documentation:

Sets the preferred height for row, row, to height.

See also rowPreferredHeight().

pub unsafe fn set_row_spacing(&self, row: c_int, spacing: c_double)[src]

Sets the spacing for row to spacing.

Calls C++ function: void QGraphicsGridLayout::setRowSpacing(int row, double spacing).

C++ documentation:

Sets the spacing for row to spacing.

See also rowSpacing().

pub unsafe fn set_row_stretch_factor(&self, row: c_int, stretch: c_int)[src]

Sets the stretch factor for row to stretch.

Calls C++ function: void QGraphicsGridLayout::setRowStretchFactor(int row, int stretch).

C++ documentation:

Sets the stretch factor for row to stretch.

See also rowStretchFactor().

pub unsafe fn set_spacing(&self, spacing: c_double)[src]

Sets the grid layout's default spacing, both vertical and horizontal, to spacing.

Calls C++ function: void QGraphicsGridLayout::setSpacing(double spacing).

C++ documentation:

Sets the grid layout's default spacing, both vertical and horizontal, to spacing.

See also rowSpacing() and columnSpacing().

pub unsafe fn set_vertical_spacing(&self, spacing: c_double)[src]

Sets the default vertical spacing for the grid layout to spacing.

Calls C++ function: void QGraphicsGridLayout::setVerticalSpacing(double spacing).

C++ documentation:

Sets the default vertical spacing for the grid layout to spacing.

See also verticalSpacing().

pub unsafe fn size_hint_2a(
    &self,
    which: SizeHint,
    constraint: impl CastInto<Ref<QSizeF>>
) -> CppBox<QSizeF>
[src]

Reimplemented from QGraphicsLayoutItem::sizeHint().

Calls C++ function: virtual QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which, const QSizeF& constraint = …) const.

C++ documentation:

Reimplemented from QGraphicsLayoutItem::sizeHint().

pub unsafe fn size_hint_1a(&self, which: SizeHint) -> CppBox<QSizeF>[src]

Reimplemented from QGraphicsLayoutItem::sizeHint().

Calls C++ function: virtual QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which) const.

C++ documentation:

Reimplemented from QGraphicsLayoutItem::sizeHint().

pub unsafe fn vertical_spacing(&self) -> c_double[src]

Returns the default vertical spacing for the grid layout.

Calls C++ function: double QGraphicsGridLayout::verticalSpacing() const.

C++ documentation:

Returns the default vertical spacing for the grid layout.

See also setVerticalSpacing().

Methods from Deref<Target = QGraphicsLayout>

pub unsafe fn activate(&self)[src]

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.

Calls C++ function: void QGraphicsLayout::activate().

C++ documentation:

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().

pub unsafe fn count(&self) -> c_int[src]

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

Calls C++ function: pure virtual int QGraphicsLayout::count() const.

C++ documentation:

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().

pub unsafe fn get_contents_margins(
    &self,
    left: *mut c_double,
    top: *mut c_double,
    right: *mut c_double,
    bottom: *mut c_double
)
[src]

Reimplemented from QGraphicsLayoutItem::getContentsMargins().

Calls C++ function: virtual void QGraphicsLayout::getContentsMargins(double* left, double* top, double* right, double* bottom) const.

C++ documentation:

Reimplemented from QGraphicsLayoutItem::getContentsMargins().

pub unsafe fn invalidate(&self)[src]

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

Calls C++ function: virtual void QGraphicsLayout::invalidate().

C++ documentation:

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().

pub unsafe fn is_activated(&self) -> bool[src]

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).

Calls C++ function: bool QGraphicsLayout::isActivated() const.

C++ documentation:

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().

pub unsafe fn item_at(&self, i: c_int) -> Ptr<QGraphicsLayoutItem>[src]

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.

Calls C++ function: pure virtual QGraphicsLayoutItem* QGraphicsLayout::itemAt(int i) const.

C++ documentation:

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().

pub unsafe fn remove_at(&self, index: c_int)[src]

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()).

Calls C++ function: pure virtual void QGraphicsLayout::removeAt(int index).

C++ documentation:

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().

pub unsafe fn set_contents_margins(
    &self,
    left: c_double,
    top: c_double,
    right: c_double,
    bottom: c_double
)
[src]

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).

Calls C++ function: void QGraphicsLayout::setContentsMargins(double left, double top, double right, double bottom).

C++ documentation:

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().

pub unsafe fn update_geometry(&self)[src]

Reimplemented from QGraphicsLayoutItem::updateGeometry().

Calls C++ function: virtual void QGraphicsLayout::updateGeometry().

C++ documentation:

Reimplemented from QGraphicsLayoutItem::updateGeometry().

pub unsafe fn widget_event(&self, e: impl CastInto<Ptr<QEvent>>)[src]

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.

Calls C++ function: virtual void QGraphicsLayout::widgetEvent(QEvent* e).

C++ documentation:

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().

Trait Implementations

impl CppDeletable for QGraphicsGridLayout[src]

unsafe fn delete(&self)[src]

Destroys the QGraphicsGridLayout object.

Calls C++ function: virtual [destructor] void QGraphicsGridLayout::~QGraphicsGridLayout().

C++ documentation:

Destroys the QGraphicsGridLayout object.

impl Deref for QGraphicsGridLayout[src]

type Target = QGraphicsLayout

The resulting type after dereferencing.

fn deref(&self) -> &QGraphicsLayout[src]

Calls C++ function: QGraphicsLayout* static_cast<QGraphicsLayout*>(QGraphicsGridLayout* ptr).

impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayout[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>[src]

Calls C++ function: QGraphicsGridLayout* dynamic_cast<QGraphicsGridLayout*>(QGraphicsLayout* ptr).

impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayoutItem[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsLayoutItem>
) -> Ptr<QGraphicsGridLayout>
[src]

Calls C++ function: QGraphicsGridLayout* dynamic_cast<QGraphicsGridLayout*>(QGraphicsLayoutItem* ptr).

impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayout[src]

unsafe fn static_downcast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>[src]

Calls C++ function: QGraphicsGridLayout* static_cast<QGraphicsGridLayout*>(QGraphicsLayout* ptr).

impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayoutItem[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsLayoutItem>
) -> Ptr<QGraphicsGridLayout>
[src]

Calls C++ function: QGraphicsGridLayout* static_cast<QGraphicsGridLayout*>(QGraphicsLayoutItem* ptr).

impl StaticUpcast<QGraphicsLayout> for QGraphicsGridLayout[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsGridLayout>) -> Ptr<QGraphicsLayout>[src]

Calls C++ function: QGraphicsLayout* static_cast<QGraphicsLayout*>(QGraphicsGridLayout* ptr).

impl StaticUpcast<QGraphicsLayoutItem> for QGraphicsGridLayout[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsGridLayout>
) -> Ptr<QGraphicsLayoutItem>
[src]

Calls C++ function: QGraphicsLayoutItem* static_cast<QGraphicsLayoutItem*>(QGraphicsGridLayout* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.