[][src]Struct qt_widgets::QScrollArea

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

The QScrollArea class provides a scrolling view onto another widget.

C++ class: QScrollArea.

C++ documentation:

The QScrollArea class provides a scrolling view onto another widget.

A scroll area is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the view can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with setWidget(). For example:

QLabel *imageLabel = new QLabel; QImage image("happyguy.png"); imageLabel->setPixmap(QPixmap::fromImage(image));

scrollArea = new QScrollArea; scrollArea->setBackgroundRole(QPalette::Dark); scrollArea->setWidget(imageLabel);

The code above creates a scroll area (shown in the images below) containing an image label. When scaling the image, the scroll area can provide the necessary scroll bars:

The scroll bars appearance depends on the currently set scroll bar policies. You can control the appearance of the scroll bars using the inherited functionality from QAbstractScrollArea.

For example, you can set the QAbstractScrollArea::horizontalScrollBarPolicy and QAbstractScrollArea::verticalScrollBarPolicy properties. Or if you want the scroll bars to adjust dynamically when the contents of the scroll area changes, you can use the horizontalScrollBar() and verticalScrollBar() functions (which enable you to access the scroll bars) and set the scroll bars' values whenever the scroll area's contents change, using the QScrollBar::setValue() function.

You can retrieve the child widget using the widget() function. The view can be made to be resizable with the setWidgetResizable() function. The alignment of the widget can be specified with setAlignment().

Two convenience functions ensureVisible() and ensureWidgetVisible() ensure a certain region of the contents is visible inside the viewport, by scrolling the contents if necessary.

Methods

impl QScrollArea[src]

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

This property holds the alignment of the scroll area's widget

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

C++ documentation:

This property holds the alignment of the scroll area's widget

A valid alignment is a combination of the following flags:

  • Qt::AlignLeft
  • Qt::AlignHCenter
  • Qt::AlignRight
  • Qt::AlignTop
  • Qt::AlignVCenter
  • Qt::AlignBottom

By default, the widget stays rooted to the top-left corner of the scroll area.

This property was introduced in Qt 4.2.

Access functions:

Qt::Alignment alignment() const
void setAlignment(Qt::Alignment)

pub unsafe fn ensure_visible_4a(
    &self,
    x: c_int,
    y: c_int,
    xmargin: c_int,
    ymargin: c_int
)
[src]

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureVisible(int x, int y, int xmargin = …, int ymargin = …).

C++ documentation:

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

pub unsafe fn ensure_visible_3a(&self, x: c_int, y: c_int, xmargin: c_int)[src]

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureVisible(int x, int y, int xmargin = …).

C++ documentation:

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

pub unsafe fn ensure_visible_2a(&self, x: c_int, y: c_int)[src]

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureVisible(int x, int y).

C++ documentation:

Scrolls the contents of the scroll area so that the point (x, y) is visible inside the region of the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

pub unsafe fn ensure_widget_visible_3a(
    &self,
    child_widget: impl CastInto<Ptr<QWidget>>,
    xmargin: c_int,
    ymargin: c_int
)
[src]

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureWidgetVisible(QWidget* childWidget, int xmargin = …, int ymargin = …).

C++ documentation:

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

This function was introduced in Qt 4.2.

pub unsafe fn ensure_widget_visible_2a(
    &self,
    child_widget: impl CastInto<Ptr<QWidget>>,
    xmargin: c_int
)
[src]

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureWidgetVisible(QWidget* childWidget, int xmargin = …).

C++ documentation:

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

This function was introduced in Qt 4.2.

pub unsafe fn ensure_widget_visible_1a(
    &self,
    child_widget: impl CastInto<Ptr<QWidget>>
)
[src]

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

Calls C++ function: void QScrollArea::ensureWidgetVisible(QWidget* childWidget).

C++ documentation:

Scrolls the contents of the scroll area so that the childWidget of QScrollArea::widget() is visible inside the viewport with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

This function was introduced in Qt 4.2.

pub unsafe fn focus_next_prev_child(&self, next: bool) -> bool[src]

Reimplemented from QWidget::focusNextPrevChild().

Calls C++ function: virtual bool QScrollArea::focusNextPrevChild(bool next).

C++ documentation:

Reimplemented from QWidget::focusNextPrevChild().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QScrollArea::metaObject() const.

pub unsafe fn new_1a(parent: impl CastInto<Ptr<QWidget>>) -> QBox<QScrollArea>[src]

Constructs an empty scroll area with the given parent.

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

C++ documentation:

Constructs an empty scroll area with the given parent.

See also setWidget().

pub unsafe fn new_0a() -> QBox<QScrollArea>[src]

The QScrollArea class provides a scrolling view onto another widget.

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

C++ documentation:

The QScrollArea class provides a scrolling view onto another widget.

A scroll area is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the view can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with setWidget(). For example:

QLabel *imageLabel = new QLabel; QImage image("happyguy.png"); imageLabel->setPixmap(QPixmap::fromImage(image));

scrollArea = new QScrollArea; scrollArea->setBackgroundRole(QPalette::Dark); scrollArea->setWidget(imageLabel);

The code above creates a scroll area (shown in the images below) containing an image label. When scaling the image, the scroll area can provide the necessary scroll bars:

The scroll bars appearance depends on the currently set scroll bar policies. You can control the appearance of the scroll bars using the inherited functionality from QAbstractScrollArea.

For example, you can set the QAbstractScrollArea::horizontalScrollBarPolicy and QAbstractScrollArea::verticalScrollBarPolicy properties. Or if you want the scroll bars to adjust dynamically when the contents of the scroll area changes, you can use the horizontalScrollBar() and verticalScrollBar() functions (which enable you to access the scroll bars) and set the scroll bars' values whenever the scroll area's contents change, using the QScrollBar::setValue() function.

You can retrieve the child widget using the widget() function. The view can be made to be resizable with the setWidgetResizable() function. The alignment of the widget can be specified with setAlignment().

Two convenience functions ensureVisible() and ensureWidgetVisible() ensure a certain region of the contents is visible inside the viewport, by scrolling the contents if necessary.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QScrollArea::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QScrollArea::qt_metacast(const char* arg1).

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

This property holds the alignment of the scroll area's widget

Calls C++ function: void QScrollArea::setAlignment(QFlags<Qt::AlignmentFlag> arg1).

C++ documentation:

This property holds the alignment of the scroll area's widget

A valid alignment is a combination of the following flags:

  • Qt::AlignLeft
  • Qt::AlignHCenter
  • Qt::AlignRight
  • Qt::AlignTop
  • Qt::AlignVCenter
  • Qt::AlignBottom

By default, the widget stays rooted to the top-left corner of the scroll area.

This property was introduced in Qt 4.2.

Access functions:

Qt::Alignment alignment() const
void setAlignment(Qt::Alignment)

pub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Sets the scroll area's widget.

Calls C++ function: void QScrollArea::setWidget(QWidget* widget).

C++ documentation:

Sets the scroll area's widget.

The widget becomes a child of the scroll area, and will be destroyed when the scroll area is deleted or when a new widget is set.

The widget's autoFillBackground property will be set to true.

If the scroll area is visible when the widget is added, you must show() it explicitly.

Note that You must add the layout of widget before you call this function; if you add it later, the widget will not be visible - regardless of when you show() the scroll area. In this case, you can also not show() the widget later.

See also widget().

pub unsafe fn set_widget_resizable(&self, resizable: bool)[src]

This property holds whether the scroll area should resize the view widget

Calls C++ function: void QScrollArea::setWidgetResizable(bool resizable).

C++ documentation:

This property holds whether the scroll area should resize the view widget

If this property is set to false (the default), the scroll area honors the size of its widget. Regardless of this property, you can programmatically resize the widget using widget()->resize(), and the scroll area will automatically adjust itself to the new size.

If this property is set to true, the scroll area will automatically resize the widget in order to avoid scroll bars where they can be avoided, or to take advantage of extra space.

Access functions:

bool widgetResizable() const
void setWidgetResizable(bool resizable)

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

Reimplemented from QWidget::sizeHint().

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

C++ documentation:

Reimplemented from QWidget::sizeHint().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

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

Removes the scroll area's widget, and passes ownership of the widget to the caller.

Calls C++ function: QWidget* QScrollArea::takeWidget().

C++ documentation:

Removes the scroll area's widget, and passes ownership of the widget to the caller.

See also widget().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QScrollArea::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QScrollArea::trUtf8(const char* s, const char* c, int n).

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

Returns the scroll area's widget, or 0 if there is none.

Calls C++ function: QWidget* QScrollArea::widget() const.

C++ documentation:

Returns the scroll area's widget, or 0 if there is none.

See also setWidget().

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

This property holds whether the scroll area should resize the view widget

Calls C++ function: bool QScrollArea::widgetResizable() const.

C++ documentation:

This property holds whether the scroll area should resize the view widget

If this property is set to false (the default), the scroll area honors the size of its widget. Regardless of this property, you can programmatically resize the widget using widget()->resize(), and the scroll area will automatically adjust itself to the new size.

If this property is set to true, the scroll area will automatically resize the widget in order to avoid scroll bars where they can be avoided, or to take advantage of extra space.

Access functions:

bool widgetResizable() const
void setWidgetResizable(bool resizable)

Methods from Deref<Target = QAbstractScrollArea>

pub unsafe fn add_scroll_bar_widget(
    &self,
    widget: impl CastInto<Ptr<QWidget>>,
    alignment: QFlags<AlignmentFlag>
)
[src]

Adds widget as a scroll bar widget in the location specified by alignment.

Calls C++ function: void QAbstractScrollArea::addScrollBarWidget(QWidget* widget, QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Adds widget as a scroll bar widget in the location specified by alignment.

Scroll bar widgets are shown next to the horizontal or vertical scroll bar, and can be placed on either side of it. If you want the scroll bar widgets to be always visible, set the scrollBarPolicy for the corresponding scroll bar to AlwaysOn.

alignment must be one of Qt::Alignleft and Qt::AlignRight, which maps to the horizontal scroll bar, or Qt::AlignTop and Qt::AlignBottom, which maps to the vertical scroll bar.

A scroll bar widget can be removed by either re-parenting the widget or deleting it. It's also possible to hide a widget with QWidget::hide()

The scroll bar widget will be resized to fit the scroll bar geometry for the current style. The following describes the case for scroll bar widgets on the horizontal scroll bar:

The height of the widget will be set to match the height of the scroll bar. To control the width of the widget, use QWidget::setMinimumWidth and QWidget::setMaximumWidth, or implement QWidget::sizeHint() and set a horizontal size policy. If you want a square widget, call QStyle::pixelMetric(QStyle::PM_ScrollBarExtent) and set the width to this value.

This function was introduced in Qt 4.2.

See also scrollBarWidgets().

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

Returns the widget in the corner between the two scroll bars.

Calls C++ function: QWidget* QAbstractScrollArea::cornerWidget() const.

C++ documentation:

Returns the widget in the corner between the two scroll bars.

By default, no corner widget is present.

This function was introduced in Qt 4.2.

See also setCornerWidget().

pub unsafe fn horizontal_scroll_bar(&self) -> QPtr<QScrollBar>[src]

Returns the horizontal scroll bar.

Calls C++ function: QScrollBar* QAbstractScrollArea::horizontalScrollBar() const.

C++ documentation:

Returns the horizontal scroll bar.

See also setHorizontalScrollBar(), horizontalScrollBarPolicy, and verticalScrollBar().

pub unsafe fn horizontal_scroll_bar_policy(&self) -> ScrollBarPolicy[src]

This property holds the policy for the horizontal scroll bar

Calls C++ function: Qt::ScrollBarPolicy QAbstractScrollArea::horizontalScrollBarPolicy() const.

C++ documentation:

This property holds the policy for the horizontal scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy horizontalScrollBarPolicy() const
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)

See also verticalScrollBarPolicy.

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

Returns the size of the viewport as if the scroll bars had no valid scrolling range.

Calls C++ function: QSize QAbstractScrollArea::maximumViewportSize() const.

C++ documentation:

Returns the size of the viewport as if the scroll bars had no valid scrolling range.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QAbstractScrollArea::metaObject() const.

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

Reimplemented from QWidget::minimumSizeHint().

Calls C++ function: virtual QSize QAbstractScrollArea::minimumSizeHint() const.

C++ documentation:

Reimplemented from QWidget::minimumSizeHint().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QAbstractScrollArea::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QAbstractScrollArea::qt_metacast(const char* arg1).

pub unsafe fn scroll_bar_widgets(
    &self,
    alignment: QFlags<AlignmentFlag>
) -> CppBox<QListOfQWidget>
[src]

Returns a list of the currently set scroll bar widgets. alignment can be any combination of the four location flags.

Calls C++ function: QList<QWidget*> QAbstractScrollArea::scrollBarWidgets(QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Returns a list of the currently set scroll bar widgets. alignment can be any combination of the four location flags.

This function was introduced in Qt 4.2.

See also addScrollBarWidget().

pub unsafe fn set_corner_widget(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Sets the widget in the corner between the two scroll bars to be widget.

Calls C++ function: void QAbstractScrollArea::setCornerWidget(QWidget* widget).

C++ documentation:

Sets the widget in the corner between the two scroll bars to be widget.

You will probably also want to set at least one of the scroll bar modes to AlwaysOn.

Passing 0 shows no widget in the corner.

Any previous corner widget is hidden.

You may call setCornerWidget() with the same widget at different times.

All widgets set here will be deleted by the scroll area when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).

Any newly set widget should have no current parent.

By default, no corner widget is present.

This function was introduced in Qt 4.2.

See also cornerWidget(), horizontalScrollBarPolicy, and horizontalScrollBarPolicy.

pub unsafe fn set_horizontal_scroll_bar(
    &self,
    scrollbar: impl CastInto<Ptr<QScrollBar>>
)
[src]

Replaces the existing horizontal scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

Calls C++ function: void QAbstractScrollArea::setHorizontalScrollBar(QScrollBar* scrollbar).

C++ documentation:

Replaces the existing horizontal scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

QAbstractScrollArea already provides horizontal and vertical scroll bars by default. You can call this function to replace the default horizontal scroll bar with your own custom scroll bar.

This function was introduced in Qt 4.2.

See also horizontalScrollBar() and setVerticalScrollBar().

pub unsafe fn set_horizontal_scroll_bar_policy(&self, arg1: ScrollBarPolicy)[src]

This property holds the policy for the horizontal scroll bar

Calls C++ function: void QAbstractScrollArea::setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy arg1).

C++ documentation:

This property holds the policy for the horizontal scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy horizontalScrollBarPolicy() const
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)

See also verticalScrollBarPolicy.

pub unsafe fn set_size_adjust_policy(&self, policy: SizeAdjustPolicy)[src]

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

Calls C++ function: void QAbstractScrollArea::setSizeAdjustPolicy(QAbstractScrollArea::SizeAdjustPolicy policy).

C++ documentation:

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

The default policy is QAbstractScrollArea::AdjustIgnored. Changing this property might actually resize the scrollarea.

This property was introduced in Qt 5.2.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

pub unsafe fn set_vertical_scroll_bar(
    &self,
    scrollbar: impl CastInto<Ptr<QScrollBar>>
)
[src]

Replaces the existing vertical scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

Calls C++ function: void QAbstractScrollArea::setVerticalScrollBar(QScrollBar* scrollbar).

C++ documentation:

Replaces the existing vertical scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

QAbstractScrollArea already provides vertical and horizontal scroll bars by default. You can call this function to replace the default vertical scroll bar with your own custom scroll bar.

This function was introduced in Qt 4.2.

See also verticalScrollBar() and setHorizontalScrollBar().

pub unsafe fn set_vertical_scroll_bar_policy(&self, arg1: ScrollBarPolicy)[src]

This property holds the policy for the vertical scroll bar

Calls C++ function: void QAbstractScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarPolicy arg1).

C++ documentation:

This property holds the policy for the vertical scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy verticalScrollBarPolicy() const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)

See also horizontalScrollBarPolicy.

pub unsafe fn set_viewport(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Sets the viewport to be the given widget. The QAbstractScrollArea will take ownership of the given widget.

Calls C++ function: void QAbstractScrollArea::setViewport(QWidget* widget).

C++ documentation:

Sets the viewport to be the given widget. The QAbstractScrollArea will take ownership of the given widget.

If widget is 0, QAbstractScrollArea will assign a new QWidget instance for the viewport.

This function was introduced in Qt 4.2.

See also viewport().

pub unsafe fn setup_viewport(&self, viewport: impl CastInto<Ptr<QWidget>>)[src]

This slot is called by QAbstractScrollArea after setViewport(viewport) has been called. Reimplement this function in a subclass of QAbstractScrollArea to initialize the new viewport before it is used.

Calls C++ function: virtual void QAbstractScrollArea::setupViewport(QWidget* viewport).

C++ documentation:

This slot is called by QAbstractScrollArea after setViewport(viewport) has been called. Reimplement this function in a subclass of QAbstractScrollArea to initialize the new viewport before it is used.

See also setViewport().

pub unsafe fn size_adjust_policy(&self) -> SizeAdjustPolicy[src]

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

Calls C++ function: QAbstractScrollArea::SizeAdjustPolicy QAbstractScrollArea::sizeAdjustPolicy() const.

C++ documentation:

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

The default policy is QAbstractScrollArea::AdjustIgnored. Changing this property might actually resize the scrollarea.

This property was introduced in Qt 5.2.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

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

Reimplemented from QWidget::sizeHint().

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

C++ documentation:

Reimplemented from QWidget::sizeHint().

Returns the sizeHint property of the scroll area. The size is determined by using viewportSizeHint() plus some extra space for scroll bars, if needed.

pub unsafe fn vertical_scroll_bar(&self) -> QPtr<QScrollBar>[src]

Returns the vertical scroll bar.

Calls C++ function: QScrollBar* QAbstractScrollArea::verticalScrollBar() const.

C++ documentation:

Returns the vertical scroll bar.

See also setVerticalScrollBar(), verticalScrollBarPolicy, and horizontalScrollBar().

pub unsafe fn vertical_scroll_bar_policy(&self) -> ScrollBarPolicy[src]

This property holds the policy for the vertical scroll bar

Calls C++ function: Qt::ScrollBarPolicy QAbstractScrollArea::verticalScrollBarPolicy() const.

C++ documentation:

This property holds the policy for the vertical scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy verticalScrollBarPolicy() const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)

See also horizontalScrollBarPolicy.

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

Returns the viewport widget.

Calls C++ function: QWidget* QAbstractScrollArea::viewport() const.

C++ documentation:

Returns the viewport widget.

Use the QScrollArea::widget() function to retrieve the contents of the viewport widget.

See also setViewport() and QScrollArea::widget().

Trait Implementations

impl CppDeletable for QScrollArea[src]

unsafe fn delete(&self)[src]

Destroys the scroll area and its child widget.

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

C++ documentation:

Destroys the scroll area and its child widget.

See also setWidget().

impl Deref for QScrollArea[src]

type Target = QAbstractScrollArea

The resulting type after dereferencing.

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

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QScrollArea* ptr).

impl DynamicCast<QScrollArea> for QAbstractScrollArea[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* dynamic_cast<QScrollArea*>(QAbstractScrollArea* ptr).

impl DynamicCast<QScrollArea> for QFrame[src]

unsafe fn dynamic_cast(ptr: Ptr<QFrame>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* dynamic_cast<QScrollArea*>(QFrame* ptr).

impl DynamicCast<QScrollArea> for QWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* dynamic_cast<QScrollArea*>(QWidget* ptr).

impl DynamicCast<QScrollArea> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* dynamic_cast<QScrollArea*>(QObject* ptr).

impl DynamicCast<QScrollArea> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* dynamic_cast<QScrollArea*>(QPaintDevice* ptr).

impl StaticDowncast<QScrollArea> for QAbstractScrollArea[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* static_cast<QScrollArea*>(QAbstractScrollArea* ptr).

impl StaticDowncast<QScrollArea> for QFrame[src]

unsafe fn static_downcast(ptr: Ptr<QFrame>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* static_cast<QScrollArea*>(QFrame* ptr).

impl StaticDowncast<QScrollArea> for QWidget[src]

unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* static_cast<QScrollArea*>(QWidget* ptr).

impl StaticDowncast<QScrollArea> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* static_cast<QScrollArea*>(QObject* ptr).

impl StaticDowncast<QScrollArea> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QScrollArea>[src]

Calls C++ function: QScrollArea* static_cast<QScrollArea*>(QPaintDevice* ptr).

impl StaticUpcast<QAbstractScrollArea> for QScrollArea[src]

unsafe fn static_upcast(ptr: Ptr<QScrollArea>) -> Ptr<QAbstractScrollArea>[src]

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QScrollArea* ptr).

impl StaticUpcast<QFrame> for QScrollArea[src]

unsafe fn static_upcast(ptr: Ptr<QScrollArea>) -> Ptr<QFrame>[src]

Calls C++ function: QFrame* static_cast<QFrame*>(QScrollArea* ptr).

impl StaticUpcast<QObject> for QScrollArea[src]

unsafe fn static_upcast(ptr: Ptr<QScrollArea>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QScrollArea* ptr).

impl StaticUpcast<QPaintDevice> for QScrollArea[src]

unsafe fn static_upcast(ptr: Ptr<QScrollArea>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QScrollArea* ptr).

impl StaticUpcast<QWidget> for QScrollArea[src]

unsafe fn static_upcast(ptr: Ptr<QScrollArea>) -> Ptr<QWidget>[src]

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