[][src]Struct qt_widgets::QAbstractScrollArea

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

The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.

C++ class: QAbstractScrollArea.

C++ documentation:

The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.

QAbstractScrollArea is a low-level abstraction of a scrolling area. The area provides a central widget called the viewport, in which the contents of the area is to be scrolled (i.e, the visible parts of the contents are rendered in the viewport).

Next to the viewport is a vertical scroll bar, and below is a horizontal scroll bar. When all of the area contents fits in the viewport, each scroll bar can be either visible or hidden depending on the scroll bar's Qt::ScrollBarPolicy. When a scroll bar is hidden, the viewport expands in order to cover all available space. When a scroll bar becomes visible again, the viewport shrinks in order to make room for the scroll bar.

It is possible to reserve a margin area around the viewport, see setViewportMargins(). The feature is mostly used to place a QHeaderView widget above or beside the scrolling area. Subclasses of QAbstractScrollArea should implement margins.

When inheriting QAbstractScrollArea, you need to do the following:

  • Control the scroll bars by setting their range, value, page step, and tracking their movements.
  • Draw the contents of the area in the viewport according to the values of the scroll bars.
  • Handle events received by the viewport in viewportEvent() - notably resize events.
  • Use viewport->update() to update the contents of the viewport instead of update() as all painting operations take place on the viewport.

With a scroll bar policy of Qt::ScrollBarAsNeeded (the default), QAbstractScrollArea shows scroll bars when they provide a non-zero scrolling range, and hides them otherwise.

The scroll bars and viewport should be updated whenever the viewport receives a resize event or the size of the contents changes. The viewport also needs to be updated when the scroll bars values change. The initial values of the scroll bars are often set when the area receives new contents.

We give a simple example, in which we have implemented a scroll area that can scroll any QWidget. We make the widget a child of the viewport; this way, we do not have to calculate which part of the widget to draw but can simply move the widget with QWidget::move(). When the area contents or the viewport size changes, we do the following:

QSize areaSize = viewport()->size(); QSize widgetSize = widget->size();

verticalScrollBar()->setPageStep(areaSize.height()); horizontalScrollBar()->setPageStep(areaSize.width()); verticalScrollBar()->setRange(0, widgetSize.height() - areaSize.height()); horizontalScrollBar()->setRange(0, widgetSize.width() - areaSize.width()); updateWidgetPosition();

When the scroll bars change value, we need to update the widget position, i.e., find the part of the widget that is to be drawn in the viewport:

int hvalue = horizontalScrollBar()->value(); int vvalue = verticalScrollBar()->value(); QPoint topLeft = viewport()->rect().topLeft();

widget->move(topLeft.x() - hvalue, topLeft.y() - vvalue);

In order to track scroll bar movements, reimplement the virtual function scrollContentsBy(). In order to fine-tune scrolling behavior, connect to a scroll bar's QAbstractSlider::actionTriggered() signal and adjust the QAbstractSlider::sliderPosition as you wish.

For convenience, QAbstractScrollArea makes all viewport events available in the virtual viewportEvent() handler. QWidget's specialized handlers are remapped to viewport events in the cases where this makes sense. The remapped specialized handlers are: paintEvent(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), wheelEvent(), dragEnterEvent(), dragMoveEvent(), dragLeaveEvent(), dropEvent(), contextMenuEvent(), and resizeEvent().

QScrollArea, which inherits QAbstractScrollArea, provides smooth scrolling for any QWidget (i.e., the widget is scrolled pixel by pixel). You only need to subclass QAbstractScrollArea if you need more specialized behavior. This is, for instance, true if the entire contents of the area is not suitable for being drawn on a QWidget or if you do not want smooth scrolling.

Methods

impl QAbstractScrollArea[src]

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 new_1a(
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QAbstractScrollArea>
[src]

Constructs a viewport.

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

C++ documentation:

Constructs a viewport.

The parent argument is sent to the QWidget constructor.

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

The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.

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

C++ documentation:

The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.

QAbstractScrollArea is a low-level abstraction of a scrolling area. The area provides a central widget called the viewport, in which the contents of the area is to be scrolled (i.e, the visible parts of the contents are rendered in the viewport).

Next to the viewport is a vertical scroll bar, and below is a horizontal scroll bar. When all of the area contents fits in the viewport, each scroll bar can be either visible or hidden depending on the scroll bar's Qt::ScrollBarPolicy. When a scroll bar is hidden, the viewport expands in order to cover all available space. When a scroll bar becomes visible again, the viewport shrinks in order to make room for the scroll bar.

It is possible to reserve a margin area around the viewport, see setViewportMargins(). The feature is mostly used to place a QHeaderView widget above or beside the scrolling area. Subclasses of QAbstractScrollArea should implement margins.

When inheriting QAbstractScrollArea, you need to do the following:

  • Control the scroll bars by setting their range, value, page step, and tracking their movements.
  • Draw the contents of the area in the viewport according to the values of the scroll bars.
  • Handle events received by the viewport in viewportEvent() - notably resize events.
  • Use viewport->update() to update the contents of the viewport instead of update() as all painting operations take place on the viewport.

With a scroll bar policy of Qt::ScrollBarAsNeeded (the default), QAbstractScrollArea shows scroll bars when they provide a non-zero scrolling range, and hides them otherwise.

The scroll bars and viewport should be updated whenever the viewport receives a resize event or the size of the contents changes. The viewport also needs to be updated when the scroll bars values change. The initial values of the scroll bars are often set when the area receives new contents.

We give a simple example, in which we have implemented a scroll area that can scroll any QWidget. We make the widget a child of the viewport; this way, we do not have to calculate which part of the widget to draw but can simply move the widget with QWidget::move(). When the area contents or the viewport size changes, we do the following:

QSize areaSize = viewport()->size(); QSize widgetSize = widget->size();

verticalScrollBar()->setPageStep(areaSize.height()); horizontalScrollBar()->setPageStep(areaSize.width()); verticalScrollBar()->setRange(0, widgetSize.height() - areaSize.height()); horizontalScrollBar()->setRange(0, widgetSize.width() - areaSize.width()); updateWidgetPosition();

When the scroll bars change value, we need to update the widget position, i.e., find the part of the widget that is to be drawn in the viewport:

int hvalue = horizontalScrollBar()->value(); int vvalue = verticalScrollBar()->value(); QPoint topLeft = viewport()->rect().topLeft();

widget->move(topLeft.x() - hvalue, topLeft.y() - vvalue);

In order to track scroll bar movements, reimplement the virtual function scrollContentsBy(). In order to fine-tune scrolling behavior, connect to a scroll bar's QAbstractSlider::actionTriggered() signal and adjust the QAbstractSlider::sliderPosition as you wish.

For convenience, QAbstractScrollArea makes all viewport events available in the virtual viewportEvent() handler. QWidget's specialized handlers are remapped to viewport events in the cases where this makes sense. The remapped specialized handlers are: paintEvent(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), wheelEvent(), dragEnterEvent(), dragMoveEvent(), dragLeaveEvent(), dropEvent(), contextMenuEvent(), and resizeEvent().

QScrollArea, which inherits QAbstractScrollArea, provides smooth scrolling for any QWidget (i.e., the widget is scrolled pixel by pixel). You only need to subclass QAbstractScrollArea if you need more specialized behavior. This is, for instance, true if the entire contents of the area is not suitable for being drawn on a QWidget or if you do not want smooth scrolling.

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 static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

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

Calls C++ function: static QString QAbstractScrollArea::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 QAbstractScrollArea::trUtf8(const char* s, const char* c, int n).

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

Methods from Deref<Target = QFrame>

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

This property holds the frame's rectangle

Calls C++ function: QRect QFrame::frameRect() const.

C++ documentation:

This property holds the frame's rectangle

The frame's rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting the rectangle does does not cause a widget update. The frame rectangle is automatically adjusted when the widget changes size.

If you set the rectangle to a null rectangle (for example, QRect(0, 0, 0, 0)), then the resulting frame rectangle is equivalent to the widget rectangle.

Access functions:

QRect frameRect() const
void setFrameRect(const QRect &)

pub unsafe fn frame_shadow(&self) -> Shadow[src]

This property holds the frame shadow value from the frame style

Calls C++ function: QFrame::Shadow QFrame::frameShadow() const.

C++ documentation:

This property holds the frame shadow value from the frame style

Access functions:

Shadow frameShadow() const
void setFrameShadow(Shadow)

See also frameStyle() and frameShape().

pub unsafe fn frame_shape(&self) -> Shape[src]

This property holds the frame shape value from the frame style

Calls C++ function: QFrame::Shape QFrame::frameShape() const.

C++ documentation:

This property holds the frame shape value from the frame style

Access functions:

Shape frameShape() const
void setFrameShape(Shape)

See also frameStyle() and frameShadow().

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

Returns the frame style.

Calls C++ function: int QFrame::frameStyle() const.

C++ documentation:

Returns the frame style.

The default value is QFrame::Plain.

See also setFrameStyle(), frameShape(), and frameShadow().

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

This property holds the width of the frame that is drawn.

Calls C++ function: int QFrame::frameWidth() const.

C++ documentation:

This property holds the width of the frame that is drawn.

Note that the frame width depends on the frame style, not only the line width and the mid-line width. For example, the style specified by NoFrame always has a frame width of 0, whereas the style Panel has a frame width equivalent to the line width.

Access functions:

int frameWidth() const

See also lineWidth(), midLineWidth(), and frameStyle().

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

This property holds the line width

Calls C++ function: int QFrame::lineWidth() const.

C++ documentation:

This property holds the line width

Note that the total line width for frames used as separators (HLine and VLine) is specified by frameWidth.

The default value is 1.

Access functions:

int lineWidth() const
void setLineWidth(int)

See also midLineWidth and frameWidth.

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

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

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

This property holds the width of the mid-line

Calls C++ function: int QFrame::midLineWidth() const.

C++ documentation:

This property holds the width of the mid-line

The default value is 0.

Access functions:

int midLineWidth() const
void setMidLineWidth(int)

See also lineWidth and frameWidth.

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

Calls C++ function: virtual int QFrame::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* QFrame::qt_metacast(const char* arg1).

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

This property holds the frame's rectangle

Calls C++ function: void QFrame::setFrameRect(const QRect& arg1).

C++ documentation:

This property holds the frame's rectangle

The frame's rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting the rectangle does does not cause a widget update. The frame rectangle is automatically adjusted when the widget changes size.

If you set the rectangle to a null rectangle (for example, QRect(0, 0, 0, 0)), then the resulting frame rectangle is equivalent to the widget rectangle.

Access functions:

QRect frameRect() const
void setFrameRect(const QRect &)

pub unsafe fn set_frame_shadow(&self, arg1: Shadow)[src]

This property holds the frame shadow value from the frame style

Calls C++ function: void QFrame::setFrameShadow(QFrame::Shadow arg1).

C++ documentation:

This property holds the frame shadow value from the frame style

Access functions:

Shadow frameShadow() const
void setFrameShadow(Shadow)

See also frameStyle() and frameShape().

pub unsafe fn set_frame_shape(&self, arg1: Shape)[src]

This property holds the frame shape value from the frame style

Calls C++ function: void QFrame::setFrameShape(QFrame::Shape arg1).

C++ documentation:

This property holds the frame shape value from the frame style

Access functions:

Shape frameShape() const
void setFrameShape(Shape)

See also frameStyle() and frameShadow().

pub unsafe fn set_frame_style(&self, arg1: c_int)[src]

Sets the frame style to style.

Calls C++ function: void QFrame::setFrameStyle(int arg1).

C++ documentation:

Sets the frame style to style.

The style is the bitwise OR between a frame shape and a frame shadow style. See the picture of the frames in the main class documentation.

The frame shapes are given in QFrame::Shape and the shadow styles in QFrame::Shadow.

If a mid-line width greater than 0 is specified, an additional line is drawn for Raised or Sunken Box, HLine, and VLine frames. The mid-color of the current color group is used for drawing middle lines.

See also frameStyle().

pub unsafe fn set_line_width(&self, arg1: c_int)[src]

This property holds the line width

Calls C++ function: void QFrame::setLineWidth(int arg1).

C++ documentation:

This property holds the line width

Note that the total line width for frames used as separators (HLine and VLine) is specified by frameWidth.

The default value is 1.

Access functions:

int lineWidth() const
void setLineWidth(int)

See also midLineWidth and frameWidth.

pub unsafe fn set_mid_line_width(&self, arg1: c_int)[src]

This property holds the width of the mid-line

Calls C++ function: void QFrame::setMidLineWidth(int arg1).

C++ documentation:

This property holds the width of the mid-line

The default value is 0.

Access functions:

int midLineWidth() const
void setMidLineWidth(int)

See also lineWidth and frameWidth.

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

Reimplemented from QWidget::sizeHint().

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

C++ documentation:

Reimplemented from QWidget::sizeHint().

Trait Implementations

impl CppDeletable for QAbstractScrollArea[src]

unsafe fn delete(&self)[src]

Destroys the viewport.

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

C++ documentation:

Destroys the viewport.

impl Deref for QAbstractScrollArea[src]

type Target = QFrame

The resulting type after dereferencing.

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

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

impl DynamicCast<QAbstractItemView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QAbstractScrollArea> for QFrame[src]

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

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

impl DynamicCast<QAbstractScrollArea> for QWidget[src]

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

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

impl DynamicCast<QAbstractScrollArea> for QObject[src]

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

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

impl DynamicCast<QAbstractScrollArea> for QPaintDevice[src]

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

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

impl DynamicCast<QColumnView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QGraphicsView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QHeaderView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QListView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QListWidget> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QMdiArea> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QPlainTextEdit> for QAbstractScrollArea[src]

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

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QAbstractScrollArea* 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<QTableView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QTableWidget> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QTextBrowser> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QTextEdit> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QTreeView> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QTreeWidget> for QAbstractScrollArea[src]

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

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

impl DynamicCast<QUndoView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QAbstractItemView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QAbstractScrollArea> for QFrame[src]

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

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

impl StaticDowncast<QAbstractScrollArea> for QWidget[src]

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

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

impl StaticDowncast<QAbstractScrollArea> for QObject[src]

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

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

impl StaticDowncast<QAbstractScrollArea> for QPaintDevice[src]

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

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

impl StaticDowncast<QColumnView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QGraphicsView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QHeaderView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QListView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QListWidget> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QMdiArea> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QPlainTextEdit> for QAbstractScrollArea[src]

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

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QAbstractScrollArea* 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<QTableView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QTableWidget> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QTextBrowser> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QTextEdit> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QTreeView> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QTreeWidget> for QAbstractScrollArea[src]

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

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

impl StaticDowncast<QUndoView> for QAbstractScrollArea[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QAbstractItemView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QColumnView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTableView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTableWidget[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTextBrowser[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTreeView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTreeWidget[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QUndoView[src]

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

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QUndoView* 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<QAbstractScrollArea> for QGraphicsView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QHeaderView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QListView[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QListWidget[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QMdiArea[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QTextEdit[src]

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

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

impl StaticUpcast<QAbstractScrollArea> for QPlainTextEdit[src]

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

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

impl StaticUpcast<QFrame> for QAbstractScrollArea[src]

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

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

impl StaticUpcast<QObject> for QAbstractScrollArea[src]

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

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

impl StaticUpcast<QPaintDevice> for QAbstractScrollArea[src]

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

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

impl StaticUpcast<QWidget> for QAbstractScrollArea[src]

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

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