#[repr(C)]pub struct QGraphicsGridLayout { /* private fields */ }
Expand description
The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.
C++ class: QGraphicsGridLayout
.
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.
Implementations§
Source§impl QGraphicsGridLayout
impl QGraphicsGridLayout
Sourcepub 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>,
)
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>, )
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 = …)
.
Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.
Sourcepub unsafe fn add_item_4a(
&self,
item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
row: c_int,
column: c_int,
alignment: QFlags<AlignmentFlag>,
)
pub unsafe fn add_item_4a( &self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>, row: c_int, column: c_int, alignment: QFlags<AlignmentFlag>, )
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 = …)
.
Adds item to the grid on row and column. You can specify an optional alignment for item.
Sourcepub 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,
)
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, )
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)
.
Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.
Sourcepub unsafe fn add_item_3a(
&self,
item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
row: c_int,
column: c_int,
)
pub unsafe fn add_item_3a( &self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>, row: c_int, column: c_int, )
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)
.
Adds item to the grid on row and column. You can specify an optional alignment for item.
Sourcepub unsafe fn alignment(
&self,
item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
) -> QFlags<AlignmentFlag>
pub unsafe fn alignment( &self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>, ) -> QFlags<AlignmentFlag>
Returns the alignment for item.
Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::alignment(QGraphicsLayoutItem* item) const
.
Returns the alignment for item.
See also setAlignment().
Sourcepub unsafe fn column_alignment(&self, column: c_int) -> QFlags<AlignmentFlag>
pub unsafe fn column_alignment(&self, column: c_int) -> QFlags<AlignmentFlag>
Returns the alignment for column.
Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::columnAlignment(int column) const
.
Returns the alignment for column.
See also setColumnAlignment().
Sourcepub unsafe fn column_count(&self) -> c_int
pub unsafe fn column_count(&self) -> c_int
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
.
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).
Sourcepub unsafe fn column_maximum_width(&self, column: c_int) -> c_double
pub unsafe fn column_maximum_width(&self, column: c_int) -> c_double
Returns the maximum width for column.
Calls C++ function: double QGraphicsGridLayout::columnMaximumWidth(int column) const
.
Returns the maximum width for column.
See also setColumnMaximumWidth().
Sourcepub unsafe fn column_minimum_width(&self, column: c_int) -> c_double
pub unsafe fn column_minimum_width(&self, column: c_int) -> c_double
Returns the minimum width for column.
Calls C++ function: double QGraphicsGridLayout::columnMinimumWidth(int column) const
.
Returns the minimum width for column.
See also setColumnMinimumWidth().
Sourcepub unsafe fn column_preferred_width(&self, column: c_int) -> c_double
pub unsafe fn column_preferred_width(&self, column: c_int) -> c_double
Returns the preferred width for column.
Calls C++ function: double QGraphicsGridLayout::columnPreferredWidth(int column) const
.
Returns the preferred width for column.
See also setColumnPreferredWidth().
Sourcepub unsafe fn column_spacing(&self, column: c_int) -> c_double
pub unsafe fn column_spacing(&self, column: c_int) -> c_double
Returns the column spacing for column.
Calls C++ function: double QGraphicsGridLayout::columnSpacing(int column) const
.
Returns the column spacing for column.
See also setColumnSpacing().
Sourcepub unsafe fn column_stretch_factor(&self, column: c_int) -> c_int
pub unsafe fn column_stretch_factor(&self, column: c_int) -> c_int
Returns the stretch factor for column.
Calls C++ function: int QGraphicsGridLayout::columnStretchFactor(int column) const
.
Returns the stretch factor for column.
See also setColumnStretchFactor().
Sourcepub unsafe fn count(&self) -> c_int
pub unsafe fn count(&self) -> c_int
Reimplemented from QGraphicsLayout::count().
Calls C++ function: virtual int QGraphicsGridLayout::count() const
.
Reimplemented from QGraphicsLayout::count().
Returns the number of layout items in this grid layout.
Sourcepub unsafe fn horizontal_spacing(&self) -> c_double
pub unsafe fn horizontal_spacing(&self) -> c_double
Returns the default horizontal spacing for the grid layout.
Calls C++ function: double QGraphicsGridLayout::horizontalSpacing() const
.
Returns the default horizontal spacing for the grid layout.
See also setHorizontalSpacing().
Sourcepub unsafe fn invalidate(&self)
pub unsafe fn invalidate(&self)
Reimplemented from QGraphicsLayout::invalidate().
Calls C++ function: virtual void QGraphicsGridLayout::invalidate()
.
Reimplemented from QGraphicsLayout::invalidate().
Sourcepub unsafe fn item_at_2a(
&self,
row: c_int,
column: c_int,
) -> Ptr<QGraphicsLayoutItem>
pub unsafe fn item_at_2a( &self, row: c_int, column: c_int, ) -> Ptr<QGraphicsLayoutItem>
Returns a pointer to the layout item at (row, column).
Calls C++ function: QGraphicsLayoutItem* QGraphicsGridLayout::itemAt(int row, int column) const
.
Returns a pointer to the layout item at (row, column).
Sourcepub unsafe fn item_at_1a(&self, index: c_int) -> Ptr<QGraphicsLayoutItem>
pub unsafe fn item_at_1a(&self, index: c_int) -> Ptr<QGraphicsLayoutItem>
Reimplemented from QGraphicsLayout::itemAt().
Calls C++ function: virtual QGraphicsLayoutItem* QGraphicsGridLayout::itemAt(int index) const
.
Reimplemented from QGraphicsLayout::itemAt().
Returns the layout item at index, or 0 if there is no layout item at this index.
Sourcepub unsafe fn new_1a(
parent: impl CastInto<Ptr<QGraphicsLayoutItem>>,
) -> CppBox<QGraphicsGridLayout>
pub unsafe fn new_1a( parent: impl CastInto<Ptr<QGraphicsLayoutItem>>, ) -> CppBox<QGraphicsGridLayout>
Constructs a QGraphicsGridLayout instance. parent is passed to QGraphicsLayout's constructor.
Calls C++ function: [constructor] void QGraphicsGridLayout::QGraphicsGridLayout(QGraphicsLayoutItem* parent = …)
.
Constructs a QGraphicsGridLayout instance. parent is passed to QGraphicsLayout’s constructor.
Sourcepub unsafe fn new_0a() -> CppBox<QGraphicsGridLayout>
pub unsafe fn new_0a() -> CppBox<QGraphicsGridLayout>
The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.
Calls C++ function: [constructor] void QGraphicsGridLayout::QGraphicsGridLayout()
.
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.
Sourcepub unsafe fn remove_at(&self, index: c_int)
pub unsafe fn remove_at(&self, index: c_int)
Reimplemented from QGraphicsLayout::removeAt().
Calls C++ function: virtual void QGraphicsGridLayout::removeAt(int index)
.
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().
Sourcepub unsafe fn remove_item(&self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>)
pub unsafe fn remove_item(&self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>)
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)
.
Removes the layout item item without destroying it. Ownership of the item is transferred to the caller.
See also addItem().
Sourcepub unsafe fn row_alignment(&self, row: c_int) -> QFlags<AlignmentFlag>
pub unsafe fn row_alignment(&self, row: c_int) -> QFlags<AlignmentFlag>
Returns the alignment of row.
Calls C++ function: QFlags<Qt::AlignmentFlag> QGraphicsGridLayout::rowAlignment(int row) const
.
Returns the alignment of row.
See also setRowAlignment().
Sourcepub unsafe fn row_count(&self) -> c_int
pub unsafe fn row_count(&self) -> c_int
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
.
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).
Sourcepub unsafe fn row_maximum_height(&self, row: c_int) -> c_double
pub unsafe fn row_maximum_height(&self, row: c_int) -> c_double
Returns the maximum height for row, row.
Calls C++ function: double QGraphicsGridLayout::rowMaximumHeight(int row) const
.
Returns the maximum height for row, row.
See also setRowMaximumHeight().
Sourcepub unsafe fn row_minimum_height(&self, row: c_int) -> c_double
pub unsafe fn row_minimum_height(&self, row: c_int) -> c_double
Returns the minimum height for row, row.
Calls C++ function: double QGraphicsGridLayout::rowMinimumHeight(int row) const
.
Returns the minimum height for row, row.
See also setRowMinimumHeight().
Sourcepub unsafe fn row_preferred_height(&self, row: c_int) -> c_double
pub unsafe fn row_preferred_height(&self, row: c_int) -> c_double
Returns the preferred height for row, row.
Calls C++ function: double QGraphicsGridLayout::rowPreferredHeight(int row) const
.
Returns the preferred height for row, row.
See also setRowPreferredHeight().
Sourcepub unsafe fn row_spacing(&self, row: c_int) -> c_double
pub unsafe fn row_spacing(&self, row: c_int) -> c_double
Returns the row spacing for row.
Calls C++ function: double QGraphicsGridLayout::rowSpacing(int row) const
.
Returns the row spacing for row.
See also setRowSpacing().
Sourcepub unsafe fn row_stretch_factor(&self, row: c_int) -> c_int
pub unsafe fn row_stretch_factor(&self, row: c_int) -> c_int
Returns the stretch factor for row.
Calls C++ function: int QGraphicsGridLayout::rowStretchFactor(int row) const
.
Returns the stretch factor for row.
See also setRowStretchFactor().
Sourcepub unsafe fn set_alignment(
&self,
item: impl CastInto<Ptr<QGraphicsLayoutItem>>,
alignment: QFlags<AlignmentFlag>,
)
pub unsafe fn set_alignment( &self, item: impl CastInto<Ptr<QGraphicsLayoutItem>>, alignment: QFlags<AlignmentFlag>, )
Sets the alignment for item to alignment.
Calls C++ function: void QGraphicsGridLayout::setAlignment(QGraphicsLayoutItem* item, QFlags<Qt::AlignmentFlag> alignment)
.
Sets the alignment for item to alignment.
See also alignment().
Sourcepub unsafe fn set_column_alignment(
&self,
column: c_int,
alignment: QFlags<AlignmentFlag>,
)
pub unsafe fn set_column_alignment( &self, column: c_int, alignment: QFlags<AlignmentFlag>, )
Sets the alignment for column to alignment.
Calls C++ function: void QGraphicsGridLayout::setColumnAlignment(int column, QFlags<Qt::AlignmentFlag> alignment)
.
Sets the alignment for column to alignment.
See also columnAlignment().
Sourcepub unsafe fn set_column_fixed_width(&self, column: c_int, width: c_double)
pub unsafe fn set_column_fixed_width(&self, column: c_int, width: c_double)
Sets the fixed width of column to width.
Calls C++ function: void QGraphicsGridLayout::setColumnFixedWidth(int column, double width)
.
Sets the fixed width of column to width.
Sourcepub unsafe fn set_column_maximum_width(&self, column: c_int, width: c_double)
pub unsafe fn set_column_maximum_width(&self, column: c_int, width: c_double)
Sets the maximum width of column to width.
Calls C++ function: void QGraphicsGridLayout::setColumnMaximumWidth(int column, double width)
.
Sets the maximum width of column to width.
See also columnMaximumWidth().
Sourcepub unsafe fn set_column_minimum_width(&self, column: c_int, width: c_double)
pub unsafe fn set_column_minimum_width(&self, column: c_int, width: c_double)
Sets the minimum width for column to width.
Calls C++ function: void QGraphicsGridLayout::setColumnMinimumWidth(int column, double width)
.
Sets the minimum width for column to width.
See also columnMinimumWidth().
Sourcepub unsafe fn set_column_preferred_width(&self, column: c_int, width: c_double)
pub unsafe fn set_column_preferred_width(&self, column: c_int, width: c_double)
Sets the preferred width for column to width.
Calls C++ function: void QGraphicsGridLayout::setColumnPreferredWidth(int column, double width)
.
Sets the preferred width for column to width.
See also columnPreferredWidth().
Sourcepub unsafe fn set_column_spacing(&self, column: c_int, spacing: c_double)
pub unsafe fn set_column_spacing(&self, column: c_int, spacing: c_double)
Sets the spacing for column to spacing.
Calls C++ function: void QGraphicsGridLayout::setColumnSpacing(int column, double spacing)
.
Sets the spacing for column to spacing.
See also columnSpacing().
Sourcepub unsafe fn set_column_stretch_factor(&self, column: c_int, stretch: c_int)
pub unsafe fn set_column_stretch_factor(&self, column: c_int, stretch: c_int)
Sets the stretch factor for column to stretch.
Calls C++ function: void QGraphicsGridLayout::setColumnStretchFactor(int column, int stretch)
.
Sets the stretch factor for column to stretch.
See also columnStretchFactor().
Sourcepub unsafe fn set_geometry(&self, rect: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_geometry(&self, rect: impl CastInto<Ref<QRectF>>)
Reimplemented from QGraphicsLayoutItem::setGeometry().
Calls C++ function: virtual void QGraphicsGridLayout::setGeometry(const QRectF& rect)
.
Reimplemented from QGraphicsLayoutItem::setGeometry().
Sets the bounding geometry of the grid layout to rect.
Sourcepub unsafe fn set_horizontal_spacing(&self, spacing: c_double)
pub unsafe fn set_horizontal_spacing(&self, spacing: c_double)
Sets the default horizontal spacing for the grid layout to spacing.
Calls C++ function: void QGraphicsGridLayout::setHorizontalSpacing(double spacing)
.
Sets the default horizontal spacing for the grid layout to spacing.
See also horizontalSpacing().
Sourcepub unsafe fn set_row_alignment(
&self,
row: c_int,
alignment: QFlags<AlignmentFlag>,
)
pub unsafe fn set_row_alignment( &self, row: c_int, alignment: QFlags<AlignmentFlag>, )
Sets the alignment of row to alignment.
Calls C++ function: void QGraphicsGridLayout::setRowAlignment(int row, QFlags<Qt::AlignmentFlag> alignment)
.
Sets the alignment of row to alignment.
See also rowAlignment().
Sourcepub unsafe fn set_row_fixed_height(&self, row: c_int, height: c_double)
pub unsafe fn set_row_fixed_height(&self, row: c_int, height: c_double)
Sets the fixed height for row, row, to height.
Calls C++ function: void QGraphicsGridLayout::setRowFixedHeight(int row, double height)
.
Sets the fixed height for row, row, to height.
Sourcepub unsafe fn set_row_maximum_height(&self, row: c_int, height: c_double)
pub unsafe fn set_row_maximum_height(&self, row: c_int, height: c_double)
Sets the maximum height for row, row, to height.
Calls C++ function: void QGraphicsGridLayout::setRowMaximumHeight(int row, double height)
.
Sets the maximum height for row, row, to height.
See also rowMaximumHeight().
Sourcepub unsafe fn set_row_minimum_height(&self, row: c_int, height: c_double)
pub unsafe fn set_row_minimum_height(&self, row: c_int, height: c_double)
Sets the minimum height for row, row, to height.
Calls C++ function: void QGraphicsGridLayout::setRowMinimumHeight(int row, double height)
.
Sets the minimum height for row, row, to height.
See also rowMinimumHeight().
Sourcepub unsafe fn set_row_preferred_height(&self, row: c_int, height: c_double)
pub unsafe fn set_row_preferred_height(&self, row: c_int, height: c_double)
Sets the preferred height for row, row, to height.
Calls C++ function: void QGraphicsGridLayout::setRowPreferredHeight(int row, double height)
.
Sets the preferred height for row, row, to height.
See also rowPreferredHeight().
Sourcepub unsafe fn set_row_spacing(&self, row: c_int, spacing: c_double)
pub unsafe fn set_row_spacing(&self, row: c_int, spacing: c_double)
Sets the spacing for row to spacing.
Calls C++ function: void QGraphicsGridLayout::setRowSpacing(int row, double spacing)
.
Sets the spacing for row to spacing.
See also rowSpacing().
Sourcepub unsafe fn set_row_stretch_factor(&self, row: c_int, stretch: c_int)
pub unsafe fn set_row_stretch_factor(&self, row: c_int, stretch: c_int)
Sets the stretch factor for row to stretch.
Calls C++ function: void QGraphicsGridLayout::setRowStretchFactor(int row, int stretch)
.
Sets the stretch factor for row to stretch.
See also rowStretchFactor().
Sourcepub unsafe fn set_spacing(&self, spacing: c_double)
pub unsafe fn set_spacing(&self, spacing: c_double)
Sets the grid layout's default spacing, both vertical and horizontal, to spacing.
Calls C++ function: void QGraphicsGridLayout::setSpacing(double spacing)
.
Sets the grid layout’s default spacing, both vertical and horizontal, to spacing.
See also rowSpacing() and columnSpacing().
Sourcepub unsafe fn set_vertical_spacing(&self, spacing: c_double)
pub unsafe fn set_vertical_spacing(&self, spacing: c_double)
Sets the default vertical spacing for the grid layout to spacing.
Calls C++ function: void QGraphicsGridLayout::setVerticalSpacing(double spacing)
.
Sets the default vertical spacing for the grid layout to spacing.
See also verticalSpacing().
Sourcepub unsafe fn size_hint_2a(
&self,
which: SizeHint,
constraint: impl CastInto<Ref<QSizeF>>,
) -> CppBox<QSizeF>
pub unsafe fn size_hint_2a( &self, which: SizeHint, constraint: impl CastInto<Ref<QSizeF>>, ) -> CppBox<QSizeF>
Reimplemented from QGraphicsLayoutItem::sizeHint().
Calls C++ function: virtual QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which, const QSizeF& constraint = …) const
.
Reimplemented from QGraphicsLayoutItem::sizeHint().
Sourcepub unsafe fn size_hint_1a(&self, which: SizeHint) -> CppBox<QSizeF>
pub unsafe fn size_hint_1a(&self, which: SizeHint) -> CppBox<QSizeF>
Reimplemented from QGraphicsLayoutItem::sizeHint().
Calls C++ function: virtual QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which) const
.
Reimplemented from QGraphicsLayoutItem::sizeHint().
Sourcepub unsafe fn vertical_spacing(&self) -> c_double
pub unsafe fn vertical_spacing(&self) -> c_double
Returns the default vertical spacing for the grid layout.
Calls C++ function: double QGraphicsGridLayout::verticalSpacing() const
.
Returns the default vertical spacing for the grid layout.
See also setVerticalSpacing().
Methods from Deref<Target = QGraphicsLayout>§
Sourcepub unsafe fn activate(&self)
pub unsafe fn activate(&self)
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()
.
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().
Sourcepub unsafe fn count(&self) -> c_int
pub unsafe fn count(&self) -> c_int
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
.
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.
Sourcepub unsafe fn get_contents_margins(
&self,
left: *mut c_double,
top: *mut c_double,
right: *mut c_double,
bottom: *mut c_double,
)
pub unsafe fn get_contents_margins( &self, left: *mut c_double, top: *mut c_double, right: *mut c_double, bottom: *mut c_double, )
Reimplemented from QGraphicsLayoutItem::getContentsMargins().
Calls C++ function: virtual void QGraphicsLayout::getContentsMargins(double* left, double* top, double* right, double* bottom) const
.
Reimplemented from QGraphicsLayoutItem::getContentsMargins().
Sourcepub unsafe fn invalidate(&self)
pub unsafe fn invalidate(&self)
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()
.
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().
Sourcepub unsafe fn is_activated(&self) -> bool
pub unsafe fn is_activated(&self) -> bool
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
.
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().
Sourcepub unsafe fn item_at(&self, i: c_int) -> Ptr<QGraphicsLayoutItem>
pub unsafe fn item_at(&self, i: c_int) -> Ptr<QGraphicsLayoutItem>
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
.
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.
Sourcepub unsafe fn remove_at(&self, index: c_int)
pub unsafe fn remove_at(&self, index: c_int)
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)
.
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.
Sourcepub unsafe fn set_contents_margins(
&self,
left: c_double,
top: c_double,
right: c_double,
bottom: c_double,
)
pub unsafe fn set_contents_margins( &self, left: c_double, top: c_double, right: c_double, bottom: c_double, )
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)
.
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().
Sourcepub unsafe fn update_geometry(&self)
pub unsafe fn update_geometry(&self)
Reimplemented from QGraphicsLayoutItem::updateGeometry().
Calls C++ function: virtual void QGraphicsLayout::updateGeometry()
.
Reimplemented from QGraphicsLayoutItem::updateGeometry().
Sourcepub unsafe fn widget_event(&self, e: impl CastInto<Ptr<QEvent>>)
pub unsafe fn widget_event(&self, e: impl CastInto<Ptr<QEvent>>)
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)
.
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().
Methods from Deref<Target = QGraphicsLayoutItem>§
Sourcepub unsafe fn contents_rect(&self) -> CppBox<QRectF>
pub unsafe fn contents_rect(&self) -> CppBox<QRectF>
Returns the contents rect in local coordinates.
Calls C++ function: 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().
Sourcepub unsafe fn effective_size_hint_2a(
&self,
which: SizeHint,
constraint: impl CastInto<Ref<QSizeF>>,
) -> CppBox<QSizeF>
pub unsafe fn effective_size_hint_2a( &self, which: SizeHint, constraint: impl CastInto<Ref<QSizeF>>, ) -> CppBox<QSizeF>
Returns the effective size hint for this QGraphicsLayoutItem.
Calls C++ function: QSizeF QGraphicsLayoutItem::effectiveSizeHint(Qt::SizeHint which, const QSizeF& constraint = …) 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().
Sourcepub unsafe fn effective_size_hint_1a(&self, which: SizeHint) -> CppBox<QSizeF>
pub unsafe fn effective_size_hint_1a(&self, which: SizeHint) -> CppBox<QSizeF>
Returns the effective size hint for this QGraphicsLayoutItem.
Calls C++ function: QSizeF QGraphicsLayoutItem::effectiveSizeHint(Qt::SizeHint which) 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().
Sourcepub unsafe fn geometry(&self) -> CppBox<QRectF>
pub unsafe fn geometry(&self) -> CppBox<QRectF>
Returns the item's geometry (e.g., position and size) as a QRectF. This function is equivalent to QRectF(pos(), size()).
Calls C++ function: 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().
Sourcepub unsafe fn get_contents_margins(
&self,
left: *mut c_double,
top: *mut c_double,
right: *mut c_double,
bottom: *mut c_double,
)
pub unsafe fn get_contents_margins( &self, left: *mut c_double, top: *mut c_double, right: *mut c_double, bottom: *mut c_double, )
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 0, that value will not be updated.
Calls C++ function: virtual void QGraphicsLayoutItem::getContentsMargins(double* left, double* top, double* right, double* 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 0, that value will not be updated.
See also QGraphicsWidget::setContentsMargins().
Sourcepub unsafe fn graphics_item(&self) -> Ptr<QGraphicsItem>
pub unsafe fn graphics_item(&self) -> Ptr<QGraphicsItem>
Returns the QGraphicsItem that this layout item represents. For QGraphicsWidget it will return itself. For custom items it can return an aggregated value.
Calls C++ function: 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().
Sourcepub unsafe fn is_layout(&self) -> bool
pub unsafe fn is_layout(&self) -> bool
Returns true
if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges other QGraphicsLayoutItem objects); otherwise returns false
.
Calls C++ function: 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.
Sourcepub unsafe fn maximum_height(&self) -> c_double
pub unsafe fn maximum_height(&self) -> c_double
Returns the maximum height.
Calls C++ function: double QGraphicsLayoutItem::maximumHeight() const
.
Returns the maximum height.
See also setMaximumHeight(), setMaximumSize(), and maximumSize().
Sourcepub unsafe fn maximum_size(&self) -> CppBox<QSizeF>
pub unsafe fn maximum_size(&self) -> CppBox<QSizeF>
Returns the maximum size.
Calls C++ function: QSizeF QGraphicsLayoutItem::maximumSize() const
.
Returns the maximum size.
See also setMaximumSize(), minimumSize(), preferredSize(), Qt::MaximumSize, and sizeHint().
Sourcepub unsafe fn maximum_width(&self) -> c_double
pub unsafe fn maximum_width(&self) -> c_double
Returns the maximum width.
Calls C++ function: double QGraphicsLayoutItem::maximumWidth() const
.
Returns the maximum width.
See also setMaximumWidth(), setMaximumSize(), and maximumSize().
Sourcepub unsafe fn minimum_height(&self) -> c_double
pub unsafe fn minimum_height(&self) -> c_double
Returns the minimum height.
Calls C++ function: double QGraphicsLayoutItem::minimumHeight() const
.
Returns the minimum height.
See also setMinimumHeight(), setMinimumSize(), and minimumSize().
Sourcepub unsafe fn minimum_size(&self) -> CppBox<QSizeF>
pub unsafe fn minimum_size(&self) -> CppBox<QSizeF>
Returns the minimum size.
Calls C++ function: QSizeF QGraphicsLayoutItem::minimumSize() const
.
Returns the minimum size.
See also setMinimumSize(), preferredSize(), maximumSize(), Qt::MinimumSize, and sizeHint().
Sourcepub unsafe fn minimum_width(&self) -> c_double
pub unsafe fn minimum_width(&self) -> c_double
Returns the minimum width.
Calls C++ function: double QGraphicsLayoutItem::minimumWidth() const
.
Returns the minimum width.
See also setMinimumWidth(), setMinimumSize(), and minimumSize().
Sourcepub unsafe fn owned_by_layout(&self) -> bool
pub unsafe fn owned_by_layout(&self) -> bool
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.
Calls C++ function: 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().
Sourcepub unsafe fn parent_layout_item(&self) -> Ptr<QGraphicsLayoutItem>
pub unsafe fn parent_layout_item(&self) -> Ptr<QGraphicsLayoutItem>
Returns the parent of this QGraphicsLayoutItem, or 0 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).
Calls C++ function: QGraphicsLayoutItem* QGraphicsLayoutItem::parentLayoutItem() const
.
Returns the parent of this QGraphicsLayoutItem, or 0 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().
Sourcepub unsafe fn preferred_height(&self) -> c_double
pub unsafe fn preferred_height(&self) -> c_double
Returns the preferred height.
Calls C++ function: double QGraphicsLayoutItem::preferredHeight() const
.
Returns the preferred height.
See also setPreferredHeight(), setPreferredSize(), and preferredSize().
Sourcepub unsafe fn preferred_size(&self) -> CppBox<QSizeF>
pub unsafe fn preferred_size(&self) -> CppBox<QSizeF>
Returns the preferred size.
Calls C++ function: QSizeF QGraphicsLayoutItem::preferredSize() const
.
Returns the preferred size.
See also setPreferredSize(), minimumSize(), maximumSize(), Qt::PreferredSize, and sizeHint().
Sourcepub unsafe fn preferred_width(&self) -> c_double
pub unsafe fn preferred_width(&self) -> c_double
Returns the preferred width.
Calls C++ function: double QGraphicsLayoutItem::preferredWidth() const
.
Returns the preferred width.
See also setPreferredWidth(), setPreferredSize(), and preferredSize().
Sourcepub unsafe fn set_geometry(&self, rect: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_geometry(&self, rect: impl CastInto<Ref<QRectF>>)
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).
Calls C++ function: 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().
Sourcepub unsafe fn set_maximum_height(&self, height: c_double)
pub unsafe fn set_maximum_height(&self, height: c_double)
Sets the maximum height to height.
Calls C++ function: void QGraphicsLayoutItem::setMaximumHeight(double height)
.
Sets the maximum height to height.
See also maximumHeight(), setMaximumSize(), and maximumSize().
Sourcepub unsafe fn set_maximum_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
pub unsafe fn set_maximum_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
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.
Calls C++ function: 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().
Sourcepub unsafe fn set_maximum_size_2a(&self, w: c_double, h: c_double)
pub unsafe fn set_maximum_size_2a(&self, w: c_double, h: c_double)
This convenience function is equivalent to calling setMaximumSize(QSizeF(w, h)).
Calls C++ function: void QGraphicsLayoutItem::setMaximumSize(double w, double h)
.
This convenience function is equivalent to calling setMaximumSize(QSizeF(w, h)).
See also maximumSize(), setMinimumSize(), setPreferredSize(), and sizeHint().
Sourcepub unsafe fn set_maximum_width(&self, width: c_double)
pub unsafe fn set_maximum_width(&self, width: c_double)
Sets the maximum width to width.
Calls C++ function: void QGraphicsLayoutItem::setMaximumWidth(double width)
.
Sets the maximum width to width.
See also maximumWidth(), setMaximumSize(), and maximumSize().
Sourcepub unsafe fn set_minimum_height(&self, height: c_double)
pub unsafe fn set_minimum_height(&self, height: c_double)
Sets the minimum height to height.
Calls C++ function: void QGraphicsLayoutItem::setMinimumHeight(double height)
.
Sets the minimum height to height.
See also minimumHeight(), setMinimumSize(), and minimumSize().
Sourcepub unsafe fn set_minimum_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
pub unsafe fn set_minimum_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
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.
Calls C++ function: 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().
Sourcepub unsafe fn set_minimum_size_2a(&self, w: c_double, h: c_double)
pub unsafe fn set_minimum_size_2a(&self, w: c_double, h: c_double)
This convenience function is equivalent to calling setMinimumSize(QSizeF(w, h)).
Calls C++ function: void QGraphicsLayoutItem::setMinimumSize(double w, double h)
.
This convenience function is equivalent to calling setMinimumSize(QSizeF(w, h)).
See also minimumSize(), setMaximumSize(), setPreferredSize(), and sizeHint().
Sourcepub unsafe fn set_minimum_width(&self, width: c_double)
pub unsafe fn set_minimum_width(&self, width: c_double)
Sets the minimum width to width.
Calls C++ function: void QGraphicsLayoutItem::setMinimumWidth(double width)
.
Sets the minimum width to width.
See also minimumWidth(), setMinimumSize(), and minimumSize().
Sourcepub unsafe fn set_parent_layout_item(
&self,
parent: impl CastInto<Ptr<QGraphicsLayoutItem>>,
)
pub unsafe fn set_parent_layout_item( &self, parent: impl CastInto<Ptr<QGraphicsLayoutItem>>, )
Sets the parent of this QGraphicsLayoutItem to parent.
Calls C++ function: void QGraphicsLayoutItem::setParentLayoutItem(QGraphicsLayoutItem* parent)
.
Sets the parent of this QGraphicsLayoutItem to parent.
See also parentLayoutItem().
Sourcepub unsafe fn set_preferred_height(&self, height: c_double)
pub unsafe fn set_preferred_height(&self, height: c_double)
Sets the preferred height to height.
Calls C++ function: void QGraphicsLayoutItem::setPreferredHeight(double height)
.
Sets the preferred height to height.
See also preferredHeight(), preferredWidth(), setPreferredSize(), and preferredSize().
Sourcepub unsafe fn set_preferred_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
pub unsafe fn set_preferred_size_1a(&self, size: impl CastInto<Ref<QSizeF>>)
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.
Calls C++ function: 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().
Sourcepub unsafe fn set_preferred_size_2a(&self, w: c_double, h: c_double)
pub unsafe fn set_preferred_size_2a(&self, w: c_double, h: c_double)
This convenience function is equivalent to calling setPreferredSize(QSizeF(w, h)).
Calls C++ function: void QGraphicsLayoutItem::setPreferredSize(double w, double h)
.
This convenience function is equivalent to calling setPreferredSize(QSizeF(w, h)).
See also preferredSize(), setMaximumSize(), setMinimumSize(), and sizeHint().
Sourcepub unsafe fn set_preferred_width(&self, width: c_double)
pub unsafe fn set_preferred_width(&self, width: c_double)
Sets the preferred width to width.
Calls C++ function: void QGraphicsLayoutItem::setPreferredWidth(double width)
.
Sets the preferred width to width.
See also preferredWidth(), preferredHeight(), setPreferredSize(), and preferredSize().
Sourcepub unsafe fn set_size_policy_1a(&self, policy: impl CastInto<Ref<QSizePolicy>>)
pub unsafe fn set_size_policy_1a(&self, policy: impl CastInto<Ref<QSizePolicy>>)
Sets the size policy to policy. The size policy describes how the item should grow horizontally and vertically when arranged in a layout.
Calls C++ function: 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().
Sourcepub unsafe fn set_size_policy_3a(
&self,
h_policy: Policy,
v_policy: Policy,
control_type: ControlType,
)
pub unsafe fn set_size_policy_3a( &self, h_policy: Policy, v_policy: Policy, control_type: ControlType, )
This is an overloaded function.
Calls C++ function: void QGraphicsLayoutItem::setSizePolicy(QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy, QSizePolicy::ControlType controlType = …)
.
This is an overloaded function.
This function is equivalent to calling setSizePolicy(QSizePolicy(hPolicy, vPolicy, controlType)).
See also sizePolicy() and QWidget::sizePolicy().
Sourcepub unsafe fn set_size_policy_2a(&self, h_policy: Policy, v_policy: Policy)
pub unsafe fn set_size_policy_2a(&self, h_policy: Policy, v_policy: Policy)
This is an overloaded function.
Calls C++ function: void QGraphicsLayoutItem::setSizePolicy(QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy)
.
This is an overloaded function.
This function is equivalent to calling setSizePolicy(QSizePolicy(hPolicy, vPolicy, controlType)).
See also sizePolicy() and QWidget::sizePolicy().
Sourcepub unsafe fn size_policy(&self) -> CppBox<QSizePolicy>
pub unsafe fn size_policy(&self) -> CppBox<QSizePolicy>
Returns the current size policy.
Calls C++ function: QSizePolicy QGraphicsLayoutItem::sizePolicy() const
.
Returns the current size policy.
See also setSizePolicy() and QWidget::sizePolicy().
Sourcepub unsafe fn update_geometry(&self)
pub unsafe fn update_geometry(&self)
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.
Calls C++ function: 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().
Trait Implementations§
Source§impl CppDeletable for QGraphicsGridLayout
impl CppDeletable for QGraphicsGridLayout
Source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys the QGraphicsGridLayout object.
Calls C++ function: virtual [destructor] void QGraphicsGridLayout::~QGraphicsGridLayout()
.
Destroys the QGraphicsGridLayout object.
Source§impl Deref for QGraphicsGridLayout
impl Deref for QGraphicsGridLayout
Source§fn deref(&self) -> &QGraphicsLayout
fn deref(&self) -> &QGraphicsLayout
Calls C++ function: QGraphicsLayout* static_cast<QGraphicsLayout*>(QGraphicsGridLayout* ptr)
.
Source§type Target = QGraphicsLayout
type Target = QGraphicsLayout
Source§impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayout
impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayout
Source§unsafe fn dynamic_cast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>
unsafe fn dynamic_cast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>
Calls C++ function: QGraphicsGridLayout* dynamic_cast<QGraphicsGridLayout*>(QGraphicsLayout* ptr)
.
Source§impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayoutItem
impl DynamicCast<QGraphicsGridLayout> for QGraphicsLayoutItem
Source§unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsLayoutItem>,
) -> Ptr<QGraphicsGridLayout>
unsafe fn dynamic_cast( ptr: Ptr<QGraphicsLayoutItem>, ) -> Ptr<QGraphicsGridLayout>
Calls C++ function: QGraphicsGridLayout* dynamic_cast<QGraphicsGridLayout*>(QGraphicsLayoutItem* ptr)
.
Source§impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayout
impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayout
Source§unsafe fn static_downcast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>
unsafe fn static_downcast(ptr: Ptr<QGraphicsLayout>) -> Ptr<QGraphicsGridLayout>
Calls C++ function: QGraphicsGridLayout* static_cast<QGraphicsGridLayout*>(QGraphicsLayout* ptr)
.
Source§impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayoutItem
impl StaticDowncast<QGraphicsGridLayout> for QGraphicsLayoutItem
Source§unsafe fn static_downcast(
ptr: Ptr<QGraphicsLayoutItem>,
) -> Ptr<QGraphicsGridLayout>
unsafe fn static_downcast( ptr: Ptr<QGraphicsLayoutItem>, ) -> Ptr<QGraphicsGridLayout>
Calls C++ function: QGraphicsGridLayout* static_cast<QGraphicsGridLayout*>(QGraphicsLayoutItem* ptr)
.
Source§impl StaticUpcast<QGraphicsLayout> for QGraphicsGridLayout
impl StaticUpcast<QGraphicsLayout> for QGraphicsGridLayout
Source§unsafe fn static_upcast(ptr: Ptr<QGraphicsGridLayout>) -> Ptr<QGraphicsLayout>
unsafe fn static_upcast(ptr: Ptr<QGraphicsGridLayout>) -> Ptr<QGraphicsLayout>
Calls C++ function: QGraphicsLayout* static_cast<QGraphicsLayout*>(QGraphicsGridLayout* ptr)
.
Source§impl StaticUpcast<QGraphicsLayoutItem> for QGraphicsGridLayout
impl StaticUpcast<QGraphicsLayoutItem> for QGraphicsGridLayout
Source§unsafe fn static_upcast(
ptr: Ptr<QGraphicsGridLayout>,
) -> Ptr<QGraphicsLayoutItem>
unsafe fn static_upcast( ptr: Ptr<QGraphicsGridLayout>, ) -> Ptr<QGraphicsLayoutItem>
Calls C++ function: QGraphicsLayoutItem* static_cast<QGraphicsLayoutItem*>(QGraphicsGridLayout* ptr)
.