[][src]Struct qt_widgets::QSpacerItem

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

The QSpacerItem class provides blank space in a layout.

C++ class: QSpacerItem.

C++ documentation:

The QSpacerItem class provides blank space in a layout.

Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:

Methods

impl QSpacerItem[src]

pub unsafe fn change_size_4a(
    &self,
    w: c_int,
    h: c_int,
    h_data: Policy,
    v_data: Policy
)
[src]

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: void QSpacerItem::changeSize(int w, int h, QSizePolicy::Policy hData = …, QSizePolicy::Policy vData = …).

C++ documentation:

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

Note that if changeSize() is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.

See also QSpacerItem::invalidate().

pub unsafe fn change_size_3a(&self, w: c_int, h: c_int, h_data: Policy)[src]

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: void QSpacerItem::changeSize(int w, int h, QSizePolicy::Policy hData = …).

C++ documentation:

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

Note that if changeSize() is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.

See also QSpacerItem::invalidate().

pub unsafe fn change_size_2a(&self, w: c_int, h: c_int)[src]

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: void QSpacerItem::changeSize(int w, int h).

C++ documentation:

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

Note that if changeSize() is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.

See also QSpacerItem::invalidate().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QSpacerItem>>
) -> Ref<QSpacerItem>
[src]

The QSpacerItem class provides blank space in a layout.

Calls C++ function: QSpacerItem& QSpacerItem::operator=(const QSpacerItem& other).

C++ documentation:

The QSpacerItem class provides blank space in a layout.

Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:

pub unsafe fn expanding_directions(&self) -> QFlags<Orientation>[src]

Reimplemented from QLayoutItem::expandingDirections().

Calls C++ function: virtual QFlags<Qt::Orientation> QSpacerItem::expandingDirections() const.

C++ documentation:

Reimplemented from QLayoutItem::expandingDirections().

pub unsafe fn geometry(&self) -> CppBox<QRect>[src]

Reimplemented from QLayoutItem::geometry().

Calls C++ function: virtual QRect QSpacerItem::geometry() const.

C++ documentation:

Reimplemented from QLayoutItem::geometry().

See also setGeometry().

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

Reimplemented from QLayoutItem::isEmpty().

Calls C++ function: virtual bool QSpacerItem::isEmpty() const.

C++ documentation:

Reimplemented from QLayoutItem::isEmpty().

Returns true.

pub unsafe fn maximum_size(&self) -> CppBox<QSize>[src]

Reimplemented from QLayoutItem::maximumSize().

Calls C++ function: virtual QSize QSpacerItem::maximumSize() const.

C++ documentation:

Reimplemented from QLayoutItem::maximumSize().

pub unsafe fn minimum_size(&self) -> CppBox<QSize>[src]

Reimplemented from QLayoutItem::minimumSize().

Calls C++ function: virtual QSize QSpacerItem::minimumSize() const.

C++ documentation:

Reimplemented from QLayoutItem::minimumSize().

pub unsafe fn new_4a(
    w: c_int,
    h: c_int,
    h_data: Policy,
    v_data: Policy
) -> CppBox<QSpacerItem>
[src]

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: [constructor] void QSpacerItem::QSpacerItem(int w, int h, QSizePolicy::Policy hData = …, QSizePolicy::Policy vData = …).

C++ documentation:

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

pub unsafe fn new_3a(w: c_int, h: c_int, h_data: Policy) -> CppBox<QSpacerItem>[src]

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: [constructor] void QSpacerItem::QSpacerItem(int w, int h, QSizePolicy::Policy hData = …).

C++ documentation:

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

pub unsafe fn new_2a(w: c_int, h: c_int) -> CppBox<QSpacerItem>[src]

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

Calls C++ function: [constructor] void QSpacerItem::QSpacerItem(int w, int h).

C++ documentation:

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hPolicy and vertical size policy vPolicy.

The default values provide a gap that is able to stretch if nothing else wants the space.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QSpacerItem>>
) -> CppBox<QSpacerItem>
[src]

The QSpacerItem class provides blank space in a layout.

Calls C++ function: [constructor] void QSpacerItem::QSpacerItem(const QSpacerItem& other).

C++ documentation:

The QSpacerItem class provides blank space in a layout.

Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:

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

Reimplemented from QLayoutItem::setGeometry().

Calls C++ function: virtual void QSpacerItem::setGeometry(const QRect& arg1).

C++ documentation:

Reimplemented from QLayoutItem::setGeometry().

See also geometry().

pub unsafe fn size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QLayoutItem::sizeHint().

Calls C++ function: virtual QSize QSpacerItem::sizeHint() const.

C++ documentation:

Reimplemented from QLayoutItem::sizeHint().

pub unsafe fn size_policy(&self) -> CppBox<QSizePolicy>[src]

Returns the size policy of this item.

Calls C++ function: QSizePolicy QSpacerItem::sizePolicy() const.

C++ documentation:

Returns the size policy of this item.

This function was introduced in Qt 5.5.

pub unsafe fn spacer_item(&self) -> Ptr<QSpacerItem>[src]

Reimplemented from QLayoutItem::spacerItem().

Calls C++ function: virtual QSpacerItem* QSpacerItem::spacerItem().

C++ documentation:

Reimplemented from QLayoutItem::spacerItem().

Returns a pointer to this object.

Methods from Deref<Target = QLayoutItem>

pub unsafe fn alignment(&self) -> QFlags<AlignmentFlag>[src]

Returns the alignment of this item.

Calls C++ function: QFlags<Qt::AlignmentFlag> QLayoutItem::alignment() const.

C++ documentation:

Returns the alignment of this item.

See also setAlignment().

pub unsafe fn control_types(&self) -> QFlags<ControlType>[src]

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

Calls C++ function: virtual QFlags<QSizePolicy::ControlType> QLayoutItem::controlTypes() const.

C++ documentation:

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

See also QSizePolicy::controlType().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QLayoutItem>>
) -> Ref<QLayoutItem>
[src]

The QLayoutItem class provides an abstract item that a QLayout manipulates.

Calls C++ function: QLayoutItem& QLayoutItem::operator=(const QLayoutItem& other).

C++ documentation:

The QLayoutItem class provides an abstract item that a QLayout manipulates.

This is used by custom layouts.

Pure virtual functions are provided to return information about the layout, including, sizeHint(), minimumSize(), maximumSize() and expanding().

The layout's geometry can be set and retrieved with setGeometry() and geometry(), and its alignment with setAlignment() and alignment().

isEmpty() returns whether the layout item is empty. If the concrete item is a QWidget, it can be retrieved using widget(). Similarly for layout() and spacerItem().

Some layouts have width and height interdependencies. These can be expressed using hasHeightForWidth(), heightForWidth(), and minimumHeightForWidth(). For more explanation see the Qt Quarterly article Trading Height for Width.

pub unsafe fn expanding_directions(&self) -> QFlags<Orientation>[src]

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

Calls C++ function: pure virtual QFlags<Qt::Orientation> QLayoutItem::expandingDirections() const.

C++ documentation:

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

pub unsafe fn geometry(&self) -> CppBox<QRect>[src]

Returns the rectangle covered by this layout item.

Calls C++ function: pure virtual QRect QLayoutItem::geometry() const.

C++ documentation:

Returns the rectangle covered by this layout item.

See also setGeometry().

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

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

Calls C++ function: virtual bool QLayoutItem::hasHeightForWidth() const.

C++ documentation:

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

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

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

pub unsafe fn height_for_width(&self, arg1: c_int) -> c_int[src]

Returns the preferred height for this layout item, given the width w.

Calls C++ function: virtual int QLayoutItem::heightForWidth(int arg1) const.

C++ documentation:

Returns the preferred height for this layout item, given the width w.

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

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

int MyLayout::heightForWidth(int w) const { if (cache_dirty || cached_width != w) { // not all C++ compilers support "mutable" MyLayout that = (MyLayout)this; int h = calculateHeightForWidth(w); that->cached_hfw = h; return h; } return cached_hfw; }

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

See also hasHeightForWidth().

pub unsafe fn invalidate(&self)[src]

Invalidates any cached information in this layout item.

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

C++ documentation:

Invalidates any cached information in this layout item.

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

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

Calls C++ function: pure virtual bool QLayoutItem::isEmpty() const.

C++ documentation:

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

pub unsafe fn layout(&self) -> QPtr<QLayout>[src]

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

Calls C++ function: virtual QLayout* QLayoutItem::layout().

C++ documentation:

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

See also spacerItem() and widget().

pub unsafe fn maximum_size(&self) -> CppBox<QSize>[src]

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

Calls C++ function: pure virtual QSize QLayoutItem::maximumSize() const.

C++ documentation:

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

pub unsafe fn minimum_height_for_width(&self, arg1: c_int) -> c_int[src]

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

Calls C++ function: virtual int QLayoutItem::minimumHeightForWidth(int arg1) const.

C++ documentation:

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

pub unsafe fn minimum_size(&self) -> CppBox<QSize>[src]

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

Calls C++ function: pure virtual QSize QLayoutItem::minimumSize() const.

C++ documentation:

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

pub unsafe fn set_alignment(&self, a: QFlags<AlignmentFlag>)[src]

Sets the alignment of this item to alignment.

Calls C++ function: void QLayoutItem::setAlignment(QFlags<Qt::AlignmentFlag> a).

C++ documentation:

Sets the alignment of this item to alignment.

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

See also alignment().

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

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

Calls C++ function: pure virtual void QLayoutItem::setGeometry(const QRect& arg1).

C++ documentation:

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

See also geometry().

pub unsafe fn size_hint(&self) -> CppBox<QSize>[src]

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

Calls C++ function: pure virtual QSize QLayoutItem::sizeHint() const.

C++ documentation:

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

pub unsafe fn spacer_item(&self) -> Ptr<QSpacerItem>[src]

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

Calls C++ function: virtual QSpacerItem* QLayoutItem::spacerItem().

C++ documentation:

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

See also layout() and widget().

pub unsafe fn widget(&self) -> QPtr<QWidget>[src]

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

Calls C++ function: virtual QWidget* QLayoutItem::widget().

C++ documentation:

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

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

See also layout() and spacerItem().

Trait Implementations

impl CppDeletable for QSpacerItem[src]

unsafe fn delete(&self)[src]

Destructor.

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

C++ documentation:

Destructor.

impl Deref for QSpacerItem[src]

type Target = QLayoutItem

The resulting type after dereferencing.

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

Calls C++ function: QLayoutItem* static_cast<QLayoutItem*>(QSpacerItem* ptr).

impl DynamicCast<QSpacerItem> for QLayoutItem[src]

unsafe fn dynamic_cast(ptr: Ptr<QLayoutItem>) -> Ptr<QSpacerItem>[src]

Calls C++ function: QSpacerItem* dynamic_cast<QSpacerItem*>(QLayoutItem* ptr).

impl StaticDowncast<QSpacerItem> for QLayoutItem[src]

unsafe fn static_downcast(ptr: Ptr<QLayoutItem>) -> Ptr<QSpacerItem>[src]

Calls C++ function: QSpacerItem* static_cast<QSpacerItem*>(QLayoutItem* ptr).

impl StaticUpcast<QLayoutItem> for QSpacerItem[src]

unsafe fn static_upcast(ptr: Ptr<QSpacerItem>) -> Ptr<QLayoutItem>[src]

Calls C++ function: QLayoutItem* static_cast<QLayoutItem*>(QSpacerItem* 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.