[][src]Struct qt_widgets::QGraphicsView

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

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.

C++ class: QGraphicsView.

C++ documentation:

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.

QGraphicsView visualizes the contents of a QGraphicsScene in a scrollable viewport. To create a scene with geometrical items, see QGraphicsScene's documentation. QGraphicsView is part of the Graphics View Framework.

To visualize a scene, you start by constructing a QGraphicsView object, passing the address of the scene you want to visualize to QGraphicsView's constructor. Alternatively, you can call setScene() to set the scene at a later point. After you call show(), the view will by default scroll to the center of the scene and display any items that are visible at this point. For example:

QGraphicsScene scene; scene.addText("Hello, world!");

QGraphicsView view(&scene); view.show();

You can explicitly scroll to any position on the scene by using the scroll bars, or by calling centerOn(). By passing a point to centerOn(), QGraphicsView will scroll its viewport to ensure that the point is centered in the view. An overload is provided for scrolling to a QGraphicsItem, in which case QGraphicsView will see to that the center of the item is centered in the view. If all you want is to ensure that a certain area is visible, (but not necessarily centered,) you can call ensureVisible() instead.

QGraphicsView can be used to visualize a whole scene, or only parts of it. The visualized area is by default detected automatically when the view is displayed for the first time (by calling QGraphicsScene::itemsBoundingRect()). To set the visualized area rectangle yourself, you can call setSceneRect(). This will adjust the scroll bars' ranges appropriately. Note that although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX).

QGraphicsView visualizes the scene by calling render(). By default, the items are drawn onto the viewport by using a regular QPainter, and using default render hints. To change the default render hints that QGraphicsView passes to QPainter when painting items, you can call setRenderHints().

By default, QGraphicsView provides a regular QWidget for the viewport widget. You can access this widget by calling viewport(), or you can replace it by calling setViewport(). To render using OpenGL, simply call setViewport(new QGLWidget). QGraphicsView takes ownership of the viewport widget.

QGraphicsView supports affine transformations, using QTransform. You can either pass a matrix to setTransform(), or you can call one of the convenience functions rotate(), scale(), translate() or shear(). The most two common transformations are scaling, which is used to implement zooming, and rotation. QGraphicsView keeps the center of the view fixed during a transformation. Because of the scene alignment (setAligment()), translating the view will have no visual impact.

You can interact with the items on the scene by using the mouse and keyboard. QGraphicsView translates the mouse and key events into scene events, (events that inherit QGraphicsSceneEvent,), and forward them to the visualized scene. In the end, it's the individual item that handles the events and reacts to them. For example, if you click on a selectable item, the item will typically let the scene know that it has been selected, and it will also redraw itself to display a selection rectangle. Similiary, if you click and drag the mouse to move a movable item, it's the item that handles the mouse moves and moves itself. Item interaction is enabled by default, and you can toggle it by calling setInteractive().

You can also provide your own custom scene interaction, by creating a subclass of QGraphicsView, and reimplementing the mouse and key event handlers. To simplify how you programmatically interact with items in the view, QGraphicsView provides the mapping functions mapToScene() and mapFromScene(), and the item accessors items() and itemAt(). These functions allow you to map points, rectangles, polygons and paths between view coordinates and scene coordinates, and to find items on the scene using view coordinates.

Methods

impl QGraphicsView[src]

pub fn slot_invalidate_scene(&self) -> Receiver<(*const QRectF, c_int)>[src]

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

Returns a built-in Qt slot QGraphicsView::invalidateScene that can be passed to qt_core::Signal::connect.

C++ documentation:

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

pub fn slot_update_scene_rect(&self) -> Receiver<(*const QRectF,)>[src]

Notifies QGraphicsView that the scene's scene rect has changed. rect is the new scene rect. If the view already has an explicitly set scene rect, this function does nothing.

Returns a built-in Qt slot QGraphicsView::updateSceneRect that can be passed to qt_core::Signal::connect.

C++ documentation:

Notifies QGraphicsView that the scene's scene rect has changed. rect is the new scene rect. If the view already has an explicitly set scene rect, this function does nothing.

See also sceneRect and QGraphicsScene::sceneRectChanged().

pub fn rubber_band_changed(
    &self
) -> Signal<(*const QRect, *const QPointF, *const QPointF)>
[src]

This signal is emitted when the rubber band rect is changed. The viewport Rect is specified by rubberBandRect. The drag start position and drag end position are provided in scene points with fromScenePoint and toScenePoint.

Returns a built-in Qt signal QGraphicsView::rubberBandChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the rubber band rect is changed. The viewport Rect is specified by rubberBandRect. The drag start position and drag end position are provided in scene points with fromScenePoint and toScenePoint.

When rubberband selection ends this signal will be emitted with null vales.

This function was introduced in Qt 5.1.

See also rubberBandRect().

pub fn slot_setup_viewport(&self) -> Receiver<(*mut QWidget,)>[src]

Reimplemented from QAbstractScrollArea::setupViewport().

Returns a built-in Qt slot QGraphicsView::setupViewport that can be passed to qt_core::Signal::connect.

C++ documentation:

Reimplemented from QAbstractScrollArea::setupViewport().

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

See also setViewport().

pub fn slot_update_scene(&self) -> Receiver<(*const QListOfQRectF,)>[src]

Schedules an update of the scene rectangles rects.

Returns a built-in Qt slot QGraphicsView::updateScene that can be passed to qt_core::Signal::connect.

C++ documentation:

Schedules an update of the scene rectangles rects.

See also QGraphicsScene::changed().

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

This property holds the alignment of the scene in the view when the whole scene is visible.

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

C++ documentation:

This property holds the alignment of the scene in the view when the whole scene is visible.

If the whole scene is visible in the view, (i.e., there are no visible scroll bars,) the view's alignment will decide where the scene will be rendered in the view. For example, if the alignment is Qt::AlignCenter, which is default, the scene will be centered in the view, and if the alignment is (Qt::AlignLeft | Qt::AlignTop), the scene will be rendered in the top-left corner of the view.

Access functions:

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

pub unsafe fn background_brush(&self) -> CppBox<QBrush>[src]

This property holds the background brush of the scene.

Calls C++ function: QBrush QGraphicsView::backgroundBrush() const.

C++ documentation:

This property holds the background brush of the scene.

This property sets the background brush for the scene in this view. It is used to override the scene's own background, and defines the behavior of drawBackground(). To provide custom background drawing for this view, you can reimplement drawBackground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

Access functions:

QBrush backgroundBrush() const
void setBackgroundBrush(const QBrush &brush)

See also QGraphicsScene::backgroundBrush and foregroundBrush.

pub unsafe fn cache_mode(&self) -> QFlags<CacheModeFlag>[src]

This property holds which parts of the view are cached

Calls C++ function: QFlags<QGraphicsView::CacheModeFlag> QGraphicsView::cacheMode() const.

C++ documentation:

This property holds which parts of the view are cached

QGraphicsView can cache pre-rendered content in a QPixmap, which is then drawn onto the viewport. The purpose of such caching is to speed up the total rendering time for areas that are slow to render. Texture, gradient and alpha blended backgrounds, for example, can be notibly slow to render; especially with a transformed view. The CacheBackground flag enables caching of the view's background. For example:

QGraphicsView view; view.setBackgroundBrush(QImage(":/images/backgroundtile.png")); view.setCacheMode(QGraphicsView::CacheBackground);

The cache is invalidated every time the view is transformed. However, when scrolling, only partial invalidation is required.

By default, nothing is cached.

Access functions:

CacheMode cacheMode() const
void setCacheMode(CacheMode mode)

See also resetCachedContent() and QPixmapCache.

pub unsafe fn center_on_q_point_f(&self, pos: impl CastInto<Ref<QPointF>>)[src]

Scrolls the contents of the viewport to ensure that the scene coordinate pos, is centered in the view.

Calls C++ function: void QGraphicsView::centerOn(const QPointF& pos).

C++ documentation:

Scrolls the contents of the viewport to ensure that the scene coordinate pos, is centered in the view.

Because pos is a floating point coordinate, and the scroll bars operate on integer coordinates, the centering is only an approximation.

Note: If the item is close to or outside the border, it will be visible in the view, but not centered.

See also ensureVisible().

pub unsafe fn center_on_2_double(&self, x: c_double, y: c_double)[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::centerOn(double x, double y).

C++ documentation:

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling centerOn(QPointF(x, y)).

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

This is an overloaded function.

Calls C++ function: void QGraphicsView::centerOn(const QGraphicsItem* item).

C++ documentation:

This is an overloaded function.

Scrolls the contents of the viewport to ensure that item is centered in the view.

See also ensureVisible().

pub unsafe fn drag_mode(&self) -> DragMode[src]

This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.

Calls C++ function: QGraphicsView::DragMode QGraphicsView::dragMode() const.

C++ documentation:

This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.

This property defines what should happen when the user clicks on the scene background and drags the mouse (e.g., scrolling the viewport contents using a pointing hand cursor, or selecting multiple items with a rubber band). The default value, NoDrag, does nothing.

This behavior only affects mouse clicks that are not handled by any item. You can define a custom behavior by creating a subclass of QGraphicsView and reimplementing mouseMoveEvent().

Access functions:

DragMode dragMode() const
void setDragMode(DragMode mode)

pub unsafe fn ensure_visible_q_rect_f2_int(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    xmargin: c_int,
    ymargin: c_int
)
[src]

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect 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 QGraphicsView::ensureVisible(const QRectF& rect, int xmargin = …, int ymargin = …).

C++ documentation:

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

pub unsafe fn ensure_visible_4_double2_int(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    xmargin: c_int,
    ymargin: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(double x, double y, double w, double h, int xmargin = …, int ymargin = …).

C++ documentation:

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin).

pub unsafe fn ensure_visible_q_graphics_item2_int(
    &self,
    item: impl CastInto<Ptr<QGraphicsItem>>,
    xmargin: c_int,
    ymargin: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(const QGraphicsItem* item, int xmargin = …, int ymargin = …).

C++ documentation:

This is an overloaded function.

Scrolls the contents of the viewport so that the center of item item is visible, 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.

See also centerOn().

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

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect 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 QGraphicsView::ensureVisible(const QRectF& rect, int xmargin = …).

C++ documentation:

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

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

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect 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 QGraphicsView::ensureVisible(const QRectF& rect).

C++ documentation:

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

pub unsafe fn ensure_visible_4_double_int(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    xmargin: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(double x, double y, double w, double h, int xmargin = …).

C++ documentation:

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin).

pub unsafe fn ensure_visible_4_double(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(double x, double y, double w, double h).

C++ documentation:

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin).

pub unsafe fn ensure_visible_q_graphics_item_int(
    &self,
    item: impl CastInto<Ptr<QGraphicsItem>>,
    xmargin: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(const QGraphicsItem* item, int xmargin = …).

C++ documentation:

This is an overloaded function.

Scrolls the contents of the viewport so that the center of item item is visible, 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.

See also centerOn().

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

This is an overloaded function.

Calls C++ function: void QGraphicsView::ensureVisible(const QGraphicsItem* item).

C++ documentation:

This is an overloaded function.

Scrolls the contents of the viewport so that the center of item item is visible, 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.

See also centerOn().

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

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

Calls C++ function: void QGraphicsView::fitInView(const QRectF& rect, Qt::AspectRatioMode aspectRadioMode = …).

C++ documentation:

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

This function keeps the view's rotation, translation, or shear. The view is scaled according to aspectRatioMode. rect will be centered in the view if it does not fit tightly.

It's common to call fitInView() from inside a reimplementation of resizeEvent(), to ensure that the whole scene, or parts of the scene, scales automatically to fit the new size of the viewport as the view is resized. Note though, that calling fitInView() from inside resizeEvent() can lead to unwanted resize recursion, if the new transformation toggles the automatic state of the scrollbars. You can toggle the scrollbar policies to always on or always off to prevent this (see horizontalScrollBarPolicy() and verticalScrollBarPolicy()).

If rect is empty, or if the viewport is too small, this function will do nothing.

See also setTransform(), ensureVisible(), and centerOn().

pub unsafe fn fit_in_view_4_double_aspect_ratio_mode(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double,
    aspect_radio_mode: AspectRatioMode
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::fitInView(double x, double y, double w, double h, Qt::AspectRatioMode aspectRadioMode = …).

C++ documentation:

This is an overloaded function.

This convenience function is equivalent to calling fitInView(QRectF(x, y, w, h), aspectRatioMode).

See also ensureVisible() and centerOn().

pub unsafe fn fit_in_view_q_graphics_item_aspect_ratio_mode(
    &self,
    item: impl CastInto<Ptr<QGraphicsItem>>,
    aspect_radio_mode: AspectRatioMode
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::fitInView(const QGraphicsItem* item, Qt::AspectRatioMode aspectRadioMode = …).

C++ documentation:

This is an overloaded function.

Ensures that item fits tightly inside the view, scaling the view according to aspectRatioMode.

See also ensureVisible() and centerOn().

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

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

Calls C++ function: void QGraphicsView::fitInView(const QRectF& rect).

C++ documentation:

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

This function keeps the view's rotation, translation, or shear. The view is scaled according to aspectRatioMode. rect will be centered in the view if it does not fit tightly.

It's common to call fitInView() from inside a reimplementation of resizeEvent(), to ensure that the whole scene, or parts of the scene, scales automatically to fit the new size of the viewport as the view is resized. Note though, that calling fitInView() from inside resizeEvent() can lead to unwanted resize recursion, if the new transformation toggles the automatic state of the scrollbars. You can toggle the scrollbar policies to always on or always off to prevent this (see horizontalScrollBarPolicy() and verticalScrollBarPolicy()).

If rect is empty, or if the viewport is too small, this function will do nothing.

See also setTransform(), ensureVisible(), and centerOn().

pub unsafe fn fit_in_view_4_double(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double
)
[src]

This is an overloaded function.

Calls C++ function: void QGraphicsView::fitInView(double x, double y, double w, double h).

C++ documentation:

This is an overloaded function.

This convenience function is equivalent to calling fitInView(QRectF(x, y, w, h), aspectRatioMode).

See also ensureVisible() and centerOn().

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

This is an overloaded function.

Calls C++ function: void QGraphicsView::fitInView(const QGraphicsItem* item).

C++ documentation:

This is an overloaded function.

Ensures that item fits tightly inside the view, scaling the view according to aspectRatioMode.

See also ensureVisible() and centerOn().

pub unsafe fn foreground_brush(&self) -> CppBox<QBrush>[src]

This property holds the foreground brush of the scene.

Calls C++ function: QBrush QGraphicsView::foregroundBrush() const.

C++ documentation:

This property holds the foreground brush of the scene.

This property sets the foreground brush for the scene in this view. It is used to override the scene's own foreground, and defines the behavior of drawForeground(). To provide custom foreground drawing for this view, you can reimplement drawForeground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

Access functions:

QBrush foregroundBrush() const
void setForegroundBrush(const QBrush &brush)

See also QGraphicsScene::foregroundBrush and backgroundBrush.

pub unsafe fn input_method_query(
    &self,
    query: InputMethodQuery
) -> CppBox<QVariant>
[src]

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: virtual QVariant QGraphicsView::inputMethodQuery(Qt::InputMethodQuery query) const.

C++ documentation:

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn invalidate_scene_2a(
    &self,
    rect: impl CastInto<Ref<QRectF>>,
    layers: QFlags<SceneLayer>
)
[src]

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

Calls C++ function: [slot] void QGraphicsView::invalidateScene(const QRectF& rect = …, QFlags<QGraphicsScene::SceneLayer> layers = …).

C++ documentation:

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

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

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

Calls C++ function: [slot] void QGraphicsView::invalidateScene(const QRectF& rect = …).

C++ documentation:

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

pub unsafe fn invalidate_scene_0a(&self)[src]

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

Calls C++ function: [slot] void QGraphicsView::invalidateScene().

C++ documentation:

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

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

This property holds whether the view allows scene interaction.

Calls C++ function: bool QGraphicsView::isInteractive() const.

C++ documentation:

This property holds whether the view allows scene interaction.

If enabled, this view is set to allow scene interaction. Otherwise, this view will not allow interaction, and any mouse or key events are ignored (i.e., it will act as a read-only view).

By default, this property is true.

Access functions:

bool isInteractive() const
void setInteractive(bool allowed)

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

Returns true if the view is transformed (i.e., a non-identity transform has been assigned, or the scrollbars are adjusted).

Calls C++ function: bool QGraphicsView::isTransformed() const.

C++ documentation:

Returns true if the view is transformed (i.e., a non-identity transform has been assigned, or the scrollbars are adjusted).

This function was introduced in Qt 4.6.

See also setTransform(), horizontalScrollBar(), and verticalScrollBar().

pub unsafe fn item_at_1a(
    &self,
    pos: impl CastInto<Ref<QPoint>>
) -> Ptr<QGraphicsItem>
[src]

Returns the item at position pos, which is in viewport coordinates. If there are several items at this position, this function returns the topmost item.

Calls C++ function: QGraphicsItem* QGraphicsView::itemAt(const QPoint& pos) const.

C++ documentation:

Returns the item at position pos, which is in viewport coordinates. If there are several items at this position, this function returns the topmost item.

Example:

void CustomView::mousePressEvent(QMouseEvent event) { if (QGraphicsItem item = itemAt(event->pos())) { qDebug() << "You clicked on item" << item; } else { qDebug("You didn't click on an item."); } }

See also items() and Sorting.

pub unsafe fn item_at_2a(&self, x: c_int, y: c_int) -> Ptr<QGraphicsItem>[src]

This is an overloaded function.

Calls C++ function: QGraphicsItem* QGraphicsView::itemAt(int x, int y) const.

C++ documentation:

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling itemAt(QPoint(x, y)).

pub unsafe fn items(&self) -> CppBox<QListOfQGraphicsItem>[src]

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items() const.

C++ documentation:

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

pub unsafe fn items_q_point(
    &self,
    pos: impl CastInto<Ref<QPoint>>
) -> CppBox<QListOfQGraphicsItem>
[src]

Returns a list of all the items at the position pos in the view. The items are listed in descending stacking order (i.e., the first item in the list is the uppermost item, and the last item is the lowermost item). pos is in viewport coordinates.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QPoint& pos) const.

C++ documentation:

Returns a list of all the items at the position pos in the view. The items are listed in descending stacking order (i.e., the first item in the list is the uppermost item, and the last item is the lowermost item). pos is in viewport coordinates.

This function is most commonly called from within mouse event handlers in a subclass in QGraphicsView. pos is in untransformed viewport coordinates, just like QMouseEvent::pos().

void CustomView::mousePressEvent(QMouseEvent *event) { qDebug() << "There are" << items(event->pos()).size() << "items at position" << mapToScene(event->pos()); }

See also QGraphicsScene::items() and Sorting.

pub unsafe fn items_2_int(
    &self,
    x: c_int,
    y: c_int
) -> CppBox<QListOfQGraphicsItem>
[src]

This function is provided for convenience. It's equivalent to calling items(QPoint(x, y)).

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(int x, int y) const.

C++ documentation:

This function is provided for convenience. It's equivalent to calling items(QPoint(x, y)).

pub unsafe fn items_q_rect_item_selection_mode(
    &self,
    rect: impl CastInto<Ref<QRect>>,
    mode: ItemSelectionMode
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QRect& rect, Qt::ItemSelectionMode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with rect. rect is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by rect are returned.

The items are sorted in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn items_4_int_item_selection_mode(
    &self,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int,
    mode: ItemSelectionMode
) -> CppBox<QListOfQGraphicsItem>
[src]

This convenience function is equivalent to calling items(QRectF(x, y, w, h), mode).

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(int x, int y, int w, int h, Qt::ItemSelectionMode mode = …) const.

C++ documentation:

This convenience function is equivalent to calling items(QRectF(x, y, w, h), mode).

This function was introduced in Qt 4.3.

pub unsafe fn items_q_polygon_item_selection_mode(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>,
    mode: ItemSelectionMode
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QPolygon& polygon, Qt::ItemSelectionMode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with polygon. polygon is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by polygon are returned.

The items are sorted by descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn items_q_painter_path_item_selection_mode(
    &self,
    path: impl CastInto<Ref<QPainterPath>>,
    mode: ItemSelectionMode
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QPainterPath& path, Qt::ItemSelectionMode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with path. path is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by path are returned.

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn items_q_rect(
    &self,
    rect: impl CastInto<Ref<QRect>>
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QRect& rect) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with rect. rect is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by rect are returned.

The items are sorted in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn items_4_int(
    &self,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int
) -> CppBox<QListOfQGraphicsItem>
[src]

This convenience function is equivalent to calling items(QRectF(x, y, w, h), mode).

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(int x, int y, int w, int h) const.

C++ documentation:

This convenience function is equivalent to calling items(QRectF(x, y, w, h), mode).

This function was introduced in Qt 4.3.

pub unsafe fn items_q_polygon(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QPolygon& polygon) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with polygon. polygon is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by polygon are returned.

The items are sorted by descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn items_q_painter_path(
    &self,
    path: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QListOfQGraphicsItem>
[src]

This is an overloaded function.

Calls C++ function: QList<QGraphicsItem*> QGraphicsView::items(const QPainterPath& path) const.

C++ documentation:

This is an overloaded function.

Returns a list of all the items that, depending on mode, are either contained by or intersect with path. path is in viewport coordinates.

The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by path are returned.

See also itemAt(), items(), mapToScene(), and Sorting.

pub unsafe fn map_from_scene_q_point_f(
    &self,
    point: impl CastInto<Ref<QPointF>>
) -> CppBox<QPoint>
[src]

Returns the scene coordinate point to viewport coordinates.

Calls C++ function: QPoint QGraphicsView::mapFromScene(const QPointF& point) const.

C++ documentation:

Returns the scene coordinate point to viewport coordinates.

See also mapToScene().

pub unsafe fn map_from_scene_q_rect_f(
    &self,
    rect: impl CastInto<Ref<QRectF>>
) -> CppBox<QPolygon>
[src]

Returns the scene rectangle rect to a viewport coordinate polygon.

Calls C++ function: QPolygon QGraphicsView::mapFromScene(const QRectF& rect) const.

C++ documentation:

Returns the scene rectangle rect to a viewport coordinate polygon.

See also mapToScene().

pub unsafe fn map_from_scene_q_polygon_f(
    &self,
    polygon: impl CastInto<Ref<QPolygonF>>
) -> CppBox<QPolygon>
[src]

Returns the scene coordinate polygon polygon to a viewport coordinate polygon.

Calls C++ function: QPolygon QGraphicsView::mapFromScene(const QPolygonF& polygon) const.

C++ documentation:

Returns the scene coordinate polygon polygon to a viewport coordinate polygon.

See also mapToScene().

pub unsafe fn map_from_scene_q_painter_path(
    &self,
    path: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Returns the scene coordinate painter path path to a viewport coordinate painter path.

Calls C++ function: QPainterPath QGraphicsView::mapFromScene(const QPainterPath& path) const.

C++ documentation:

Returns the scene coordinate painter path path to a viewport coordinate painter path.

See also mapToScene().

pub unsafe fn map_from_scene_2_double(
    &self,
    x: c_double,
    y: c_double
) -> CppBox<QPoint>
[src]

This function is provided for convenience. It's equivalent to calling mapFromScene(QPointF(x, y)).

Calls C++ function: QPoint QGraphicsView::mapFromScene(double x, double y) const.

C++ documentation:

This function is provided for convenience. It's equivalent to calling mapFromScene(QPointF(x, y)).

pub unsafe fn map_from_scene_4_double(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double
) -> CppBox<QPolygon>
[src]

This function is provided for convenience. It's equivalent to calling mapFromScene(QRectF(x, y, w, h)).

Calls C++ function: QPolygon QGraphicsView::mapFromScene(double x, double y, double w, double h) const.

C++ documentation:

This function is provided for convenience. It's equivalent to calling mapFromScene(QRectF(x, y, w, h)).

pub unsafe fn map_to_scene_q_point(
    &self,
    point: impl CastInto<Ref<QPoint>>
) -> CppBox<QPointF>
[src]

Returns the viewport coordinate point mapped to scene coordinates.

Calls C++ function: QPointF QGraphicsView::mapToScene(const QPoint& point) const.

C++ documentation:

Returns the viewport coordinate point mapped to scene coordinates.

Note: It can be useful to map the whole rectangle covered by the pixel at point instead of the point itself. To do this, you can call mapToScene(QRect(point, QSize(2, 2))).

See also mapFromScene().

pub unsafe fn map_to_scene_q_rect(
    &self,
    rect: impl CastInto<Ref<QRect>>
) -> CppBox<QPolygonF>
[src]

Returns the viewport rectangle rect mapped to a scene coordinate polygon.

Calls C++ function: QPolygonF QGraphicsView::mapToScene(const QRect& rect) const.

C++ documentation:

Returns the viewport rectangle rect mapped to a scene coordinate polygon.

See also mapFromScene().

pub unsafe fn map_to_scene_q_polygon(
    &self,
    polygon: impl CastInto<Ref<QPolygon>>
) -> CppBox<QPolygonF>
[src]

Returns the viewport polygon polygon mapped to a scene coordinate polygon.

Calls C++ function: QPolygonF QGraphicsView::mapToScene(const QPolygon& polygon) const.

C++ documentation:

Returns the viewport polygon polygon mapped to a scene coordinate polygon.

See also mapFromScene().

pub unsafe fn map_to_scene_q_painter_path(
    &self,
    path: impl CastInto<Ref<QPainterPath>>
) -> CppBox<QPainterPath>
[src]

Returns the viewport painter path path mapped to a scene coordinate painter path.

Calls C++ function: QPainterPath QGraphicsView::mapToScene(const QPainterPath& path) const.

C++ documentation:

Returns the viewport painter path path mapped to a scene coordinate painter path.

See also mapFromScene().

pub unsafe fn map_to_scene_2_int(&self, x: c_int, y: c_int) -> CppBox<QPointF>[src]

This function is provided for convenience. It's equivalent to calling mapToScene(QPoint(x, y)).

Calls C++ function: QPointF QGraphicsView::mapToScene(int x, int y) const.

C++ documentation:

This function is provided for convenience. It's equivalent to calling mapToScene(QPoint(x, y)).

pub unsafe fn map_to_scene_4_int(
    &self,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int
) -> CppBox<QPolygonF>
[src]

This function is provided for convenience. It's equivalent to calling mapToScene(QRect(x, y, w, h)).

Calls C++ function: QPolygonF QGraphicsView::mapToScene(int x, int y, int w, int h) const.

C++ documentation:

This function is provided for convenience. It's equivalent to calling mapToScene(QRect(x, y, w, h)).

pub unsafe fn matrix(&self) -> CppBox<QMatrix>[src]

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

Calls C++ function: QMatrix QGraphicsView::matrix() const.

C++ documentation:

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

See also setMatrix(), transform(), rotate(), scale(), shear(), and translate().

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

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

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

Constructs a QGraphicsView. parent is passed to QWidget's constructor.

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

C++ documentation:

Constructs a QGraphicsView. parent is passed to QWidget's constructor.

pub unsafe fn from_q_graphics_scene_q_widget(
    scene: impl CastInto<Ptr<QGraphicsScene>>,
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QGraphicsView>
[src]

Constructs a QGraphicsView and sets the visualized scene to scene. parent is passed to QWidget's constructor.

Calls C++ function: [constructor] void QGraphicsView::QGraphicsView(QGraphicsScene* scene, QWidget* parent = …).

C++ documentation:

Constructs a QGraphicsView and sets the visualized scene to scene. parent is passed to QWidget's constructor.

pub unsafe fn new() -> QBox<QGraphicsView>[src]

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.

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

C++ documentation:

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.

QGraphicsView visualizes the contents of a QGraphicsScene in a scrollable viewport. To create a scene with geometrical items, see QGraphicsScene's documentation. QGraphicsView is part of the Graphics View Framework.

To visualize a scene, you start by constructing a QGraphicsView object, passing the address of the scene you want to visualize to QGraphicsView's constructor. Alternatively, you can call setScene() to set the scene at a later point. After you call show(), the view will by default scroll to the center of the scene and display any items that are visible at this point. For example:

QGraphicsScene scene; scene.addText("Hello, world!");

QGraphicsView view(&scene); view.show();

You can explicitly scroll to any position on the scene by using the scroll bars, or by calling centerOn(). By passing a point to centerOn(), QGraphicsView will scroll its viewport to ensure that the point is centered in the view. An overload is provided for scrolling to a QGraphicsItem, in which case QGraphicsView will see to that the center of the item is centered in the view. If all you want is to ensure that a certain area is visible, (but not necessarily centered,) you can call ensureVisible() instead.

QGraphicsView can be used to visualize a whole scene, or only parts of it. The visualized area is by default detected automatically when the view is displayed for the first time (by calling QGraphicsScene::itemsBoundingRect()). To set the visualized area rectangle yourself, you can call setSceneRect(). This will adjust the scroll bars' ranges appropriately. Note that although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX).

QGraphicsView visualizes the scene by calling render(). By default, the items are drawn onto the viewport by using a regular QPainter, and using default render hints. To change the default render hints that QGraphicsView passes to QPainter when painting items, you can call setRenderHints().

By default, QGraphicsView provides a regular QWidget for the viewport widget. You can access this widget by calling viewport(), or you can replace it by calling setViewport(). To render using OpenGL, simply call setViewport(new QGLWidget). QGraphicsView takes ownership of the viewport widget.

QGraphicsView supports affine transformations, using QTransform. You can either pass a matrix to setTransform(), or you can call one of the convenience functions rotate(), scale(), translate() or shear(). The most two common transformations are scaling, which is used to implement zooming, and rotation. QGraphicsView keeps the center of the view fixed during a transformation. Because of the scene alignment (setAligment()), translating the view will have no visual impact.

You can interact with the items on the scene by using the mouse and keyboard. QGraphicsView translates the mouse and key events into scene events, (events that inherit QGraphicsSceneEvent,), and forward them to the visualized scene. In the end, it's the individual item that handles the events and reacts to them. For example, if you click on a selectable item, the item will typically let the scene know that it has been selected, and it will also redraw itself to display a selection rectangle. Similiary, if you click and drag the mouse to move a movable item, it's the item that handles the mouse moves and moves itself. Item interaction is enabled by default, and you can toggle it by calling setInteractive().

You can also provide your own custom scene interaction, by creating a subclass of QGraphicsView, and reimplementing the mouse and key event handlers. To simplify how you programmatically interact with items in the view, QGraphicsView provides the mapping functions mapToScene() and mapFromScene(), and the item accessors items() and itemAt(). These functions allow you to map points, rectangles, polygons and paths between view coordinates and scene coordinates, and to find items on the scene using view coordinates.

pub unsafe fn from_q_graphics_scene(
    scene: impl CastInto<Ptr<QGraphicsScene>>
) -> QBox<QGraphicsView>
[src]

Constructs a QGraphicsView and sets the visualized scene to scene. parent is passed to QWidget's constructor.

Calls C++ function: [constructor] void QGraphicsView::QGraphicsView(QGraphicsScene* scene).

C++ documentation:

Constructs a QGraphicsView and sets the visualized scene to scene. parent is passed to QWidget's constructor.

pub unsafe fn optimization_flags(&self) -> QFlags<OptimizationFlag>[src]

flags that can be used to tune QGraphicsView's performance.

Calls C++ function: QFlags<QGraphicsView::OptimizationFlag> QGraphicsView::optimizationFlags() const.

C++ documentation:

flags that can be used to tune QGraphicsView's performance.

QGraphicsView uses clipping, extra bounding rect adjustments, and certain other aids to improve rendering quality and performance for the common case graphics scene. However, depending on the target platform, the scene, and the viewport in use, some of these operations can degrade performance.

The effect varies from flag to flag; see the OptimizationFlags documentation for details.

By default, no optimization flags are enabled.

This property was introduced in Qt 4.3.

Access functions:

OptimizationFlags optimizationFlags() const
void setOptimizationFlags(OptimizationFlags flags)

See also setOptimizationFlag().

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

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

pub unsafe fn render_4a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target: impl CastInto<Ref<QRectF>>,
    source: impl CastInto<Ref<QRect>>,
    aspect_ratio_mode: AspectRatioMode
)
[src]

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

Calls C++ function: void QGraphicsView::render(QPainter* painter, const QRectF& target = …, const QRect& source = …, Qt::AspectRatioMode aspectRatioMode = …).

C++ documentation:

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:


  QGraphicsScene scene;
  scene.addItem(...
  ...

  QGraphicsView view(&scene);
  view.show();
  ...

  QPrinter printer(QPrinter::HighResolution);
  printer.setPageSize(QPrinter::A4);
  QPainter painter(&printer);

  // print, fitting the viewport contents into a full page
  view.render(&painter);

  // print the upper half of the viewport into the lower.
  // half of the page.
  QRect viewport = view.viewport()->rect();
  view.render(&painter,
              QRectF(0, printer.height() / 2,
                     printer.width(), printer.height() / 2),
              viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

pub unsafe fn render_3a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target: impl CastInto<Ref<QRectF>>,
    source: impl CastInto<Ref<QRect>>
)
[src]

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

Calls C++ function: void QGraphicsView::render(QPainter* painter, const QRectF& target = …, const QRect& source = …).

C++ documentation:

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:


  QGraphicsScene scene;
  scene.addItem(...
  ...

  QGraphicsView view(&scene);
  view.show();
  ...

  QPrinter printer(QPrinter::HighResolution);
  printer.setPageSize(QPrinter::A4);
  QPainter painter(&printer);

  // print, fitting the viewport contents into a full page
  view.render(&painter);

  // print the upper half of the viewport into the lower.
  // half of the page.
  QRect viewport = view.viewport()->rect();
  view.render(&painter,
              QRectF(0, printer.height() / 2,
                     printer.width(), printer.height() / 2),
              viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

pub unsafe fn render_2a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target: impl CastInto<Ref<QRectF>>
)
[src]

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

Calls C++ function: void QGraphicsView::render(QPainter* painter, const QRectF& target = …).

C++ documentation:

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:


  QGraphicsScene scene;
  scene.addItem(...
  ...

  QGraphicsView view(&scene);
  view.show();
  ...

  QPrinter printer(QPrinter::HighResolution);
  printer.setPageSize(QPrinter::A4);
  QPainter painter(&printer);

  // print, fitting the viewport contents into a full page
  view.render(&painter);

  // print the upper half of the viewport into the lower.
  // half of the page.
  QRect viewport = view.viewport()->rect();
  view.render(&painter,
              QRectF(0, printer.height() / 2,
                     printer.width(), printer.height() / 2),
              viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

pub unsafe fn render_1a(&self, painter: impl CastInto<Ptr<QPainter>>)[src]

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

Calls C++ function: void QGraphicsView::render(QPainter* painter).

C++ documentation:

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:


  QGraphicsScene scene;
  scene.addItem(...
  ...

  QGraphicsView view(&scene);
  view.show();
  ...

  QPrinter printer(QPrinter::HighResolution);
  printer.setPageSize(QPrinter::A4);
  QPainter painter(&printer);

  // print, fitting the viewport contents into a full page
  view.render(&painter);

  // print the upper half of the viewport into the lower.
  // half of the page.
  QRect viewport = view.viewport()->rect();
  view.render(&painter,
              QRectF(0, printer.height() / 2,
                     printer.width(), printer.height() / 2),
              viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

pub unsafe fn render_hints(&self) -> QFlags<RenderHint>[src]

This property holds the default render hints for the view

Calls C++ function: QFlags<QPainter::RenderHint> QGraphicsView::renderHints() const.

C++ documentation:

This property holds the default render hints for the view

These hints are used to initialize QPainter before each visible item is drawn. QPainter uses render hints to toggle rendering features such as antialiasing and smooth pixmap transformation.

QPainter::TextAntialiasing is enabled by default.

Example:

QGraphicsScene scene; scene.addRect(QRectF(-10, -10, 20, 20));

QGraphicsView view(&scene); view.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); view.show();

Access functions:

QPainter::RenderHints renderHints() const
void setRenderHints(QPainter::RenderHints hints)

pub unsafe fn reset_cached_content(&self)[src]

Resets any cached content. Calling this function will clear QGraphicsView's cache. If the current cache mode is CacheNone, this function does nothing.

Calls C++ function: void QGraphicsView::resetCachedContent().

C++ documentation:

Resets any cached content. Calling this function will clear QGraphicsView's cache. If the current cache mode is CacheNone, this function does nothing.

This function is called automatically for you when the backgroundBrush or QGraphicsScene::backgroundBrush properties change; you only need to call this function if you have reimplemented QGraphicsScene::drawBackground() or QGraphicsView::drawBackground() to draw a custom background, and need to trigger a full redraw.

See also cacheMode().

pub unsafe fn reset_matrix(&self)[src]

Resets the view transformation matrix to the identity matrix.

Calls C++ function: void QGraphicsView::resetMatrix().

C++ documentation:

Resets the view transformation matrix to the identity matrix.

See also resetTransform().

pub unsafe fn reset_transform(&self)[src]

Resets the view transformation to the identity matrix.

Calls C++ function: void QGraphicsView::resetTransform().

C++ documentation:

Resets the view transformation to the identity matrix.

See also transform() and setTransform().

pub unsafe fn resize_anchor(&self) -> ViewportAnchor[src]

how the view should position the scene when the view is resized.

Calls C++ function: QGraphicsView::ViewportAnchor QGraphicsView::resizeAnchor() const.

C++ documentation:

how the view should position the scene when the view is resized.

QGraphicsView uses this property to decide how to position the scene in the viewport when the viewport widget's size changes. The default behavior, NoAnchor, leaves the scene's position unchanged during a resize; the top-left corner of the view will appear to be anchored while resizing.

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

Access functions:

ViewportAnchor resizeAnchor() const
void setResizeAnchor(ViewportAnchor anchor)

See also alignment and transformationAnchor.

pub unsafe fn rotate(&self, angle: c_double)[src]

Rotates the current view transformation angle degrees clockwise.

Calls C++ function: void QGraphicsView::rotate(double angle).

C++ documentation:

Rotates the current view transformation angle degrees clockwise.

See also setTransform(), transform(), scale(), shear(), and translate().

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

This functions returns the current rubber band area (in viewport coordinates) if the user is currently doing an itemselection with rubber band. When the user is not using the rubber band this functions returns (a null) QRectF().

Calls C++ function: QRect QGraphicsView::rubberBandRect() const.

C++ documentation:

This functions returns the current rubber band area (in viewport coordinates) if the user is currently doing an itemselection with rubber band. When the user is not using the rubber band this functions returns (a null) QRectF().

Notice that part of this QRect can be outise the visual viewport. It can e.g contain negative values.

This function was introduced in Qt 5.1.

See also rubberBandSelectionMode and rubberBandChanged().

pub unsafe fn rubber_band_selection_mode(&self) -> ItemSelectionMode[src]

This property holds the behavior for selecting items with a rubber band selection rectangle.

Calls C++ function: Qt::ItemSelectionMode QGraphicsView::rubberBandSelectionMode() const.

C++ documentation:

This property holds the behavior for selecting items with a rubber band selection rectangle.

This property defines how items are selected when using the RubberBandDrag drag mode.

The default value is Qt::IntersectsItemShape; all items whose shape intersects with or is contained by the rubber band are selected.

This property was introduced in Qt 4.3.

Access functions:

Qt::ItemSelectionMode rubberBandSelectionMode() const
void setRubberBandSelectionMode(Qt::ItemSelectionMode mode)

See also dragMode, items(), and rubberBandRect().

pub unsafe fn scale(&self, sx: c_double, sy: c_double)[src]

Scales the current view transformation by (sx, sy).

Calls C++ function: void QGraphicsView::scale(double sx, double sy).

C++ documentation:

Scales the current view transformation by (sx, sy).

See also setTransform(), transform(), rotate(), shear(), and translate().

pub unsafe fn scene(&self) -> QPtr<QGraphicsScene>[src]

Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned.

Calls C++ function: QGraphicsScene* QGraphicsView::scene() const.

C++ documentation:

Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned.

See also setScene().

pub unsafe fn scene_rect(&self) -> CppBox<QRectF>[src]

This property holds the area of the scene visualized by this view.

Calls C++ function: QRectF QGraphicsView::sceneRect() const.

C++ documentation:

This property holds the area of the scene visualized by this view.

The scene rectangle defines the extent of the scene, and in the view's case, this means the area of the scene that you can navigate using the scroll bars.

If unset, or if a null QRectF is set, this property has the same value as QGraphicsScene::sceneRect, and it changes with QGraphicsScene::sceneRect. Otherwise, the view's scene rect is unaffected by the scene.

Note that, although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX). When the scene is larger than the scroll bars' values, you can choose to use translate() to navigate the scene instead.

By default, this property contains a rectangle at the origin with zero width and height.

Access functions:

QRectF sceneRect() const
void setSceneRect(const QRectF &rect)
void setSceneRect(qreal x, qreal y, qreal w, qreal h)

See also QGraphicsScene::sceneRect.

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

This property holds the alignment of the scene in the view when the whole scene is visible.

Calls C++ function: void QGraphicsView::setAlignment(QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

This property holds the alignment of the scene in the view when the whole scene is visible.

If the whole scene is visible in the view, (i.e., there are no visible scroll bars,) the view's alignment will decide where the scene will be rendered in the view. For example, if the alignment is Qt::AlignCenter, which is default, the scene will be centered in the view, and if the alignment is (Qt::AlignLeft | Qt::AlignTop), the scene will be rendered in the top-left corner of the view.

Access functions:

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

pub unsafe fn set_background_brush(&self, brush: impl CastInto<Ref<QBrush>>)[src]

This property holds the background brush of the scene.

Calls C++ function: void QGraphicsView::setBackgroundBrush(const QBrush& brush).

C++ documentation:

This property holds the background brush of the scene.

This property sets the background brush for the scene in this view. It is used to override the scene's own background, and defines the behavior of drawBackground(). To provide custom background drawing for this view, you can reimplement drawBackground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

Access functions:

QBrush backgroundBrush() const
void setBackgroundBrush(const QBrush &brush)

See also QGraphicsScene::backgroundBrush and foregroundBrush.

pub unsafe fn set_cache_mode(&self, mode: QFlags<CacheModeFlag>)[src]

This property holds which parts of the view are cached

Calls C++ function: void QGraphicsView::setCacheMode(QFlags<QGraphicsView::CacheModeFlag> mode).

C++ documentation:

This property holds which parts of the view are cached

QGraphicsView can cache pre-rendered content in a QPixmap, which is then drawn onto the viewport. The purpose of such caching is to speed up the total rendering time for areas that are slow to render. Texture, gradient and alpha blended backgrounds, for example, can be notibly slow to render; especially with a transformed view. The CacheBackground flag enables caching of the view's background. For example:

QGraphicsView view; view.setBackgroundBrush(QImage(":/images/backgroundtile.png")); view.setCacheMode(QGraphicsView::CacheBackground);

The cache is invalidated every time the view is transformed. However, when scrolling, only partial invalidation is required.

By default, nothing is cached.

Access functions:

CacheMode cacheMode() const
void setCacheMode(CacheMode mode)

See also resetCachedContent() and QPixmapCache.

pub unsafe fn set_drag_mode(&self, mode: DragMode)[src]

This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.

Calls C++ function: void QGraphicsView::setDragMode(QGraphicsView::DragMode mode).

C++ documentation:

This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.

This property defines what should happen when the user clicks on the scene background and drags the mouse (e.g., scrolling the viewport contents using a pointing hand cursor, or selecting multiple items with a rubber band). The default value, NoDrag, does nothing.

This behavior only affects mouse clicks that are not handled by any item. You can define a custom behavior by creating a subclass of QGraphicsView and reimplementing mouseMoveEvent().

Access functions:

DragMode dragMode() const
void setDragMode(DragMode mode)

pub unsafe fn set_foreground_brush(&self, brush: impl CastInto<Ref<QBrush>>)[src]

This property holds the foreground brush of the scene.

Calls C++ function: void QGraphicsView::setForegroundBrush(const QBrush& brush).

C++ documentation:

This property holds the foreground brush of the scene.

This property sets the foreground brush for the scene in this view. It is used to override the scene's own foreground, and defines the behavior of drawForeground(). To provide custom foreground drawing for this view, you can reimplement drawForeground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

Access functions:

QBrush foregroundBrush() const
void setForegroundBrush(const QBrush &brush)

See also QGraphicsScene::foregroundBrush and backgroundBrush.

pub unsafe fn set_interactive(&self, allowed: bool)[src]

This property holds whether the view allows scene interaction.

Calls C++ function: void QGraphicsView::setInteractive(bool allowed).

C++ documentation:

This property holds whether the view allows scene interaction.

If enabled, this view is set to allow scene interaction. Otherwise, this view will not allow interaction, and any mouse or key events are ignored (i.e., it will act as a read-only view).

By default, this property is true.

Access functions:

bool isInteractive() const
void setInteractive(bool allowed)

pub unsafe fn set_matrix_2a(
    &self,
    matrix: impl CastInto<Ref<QMatrix>>,
    combine: bool
)
[src]

Sets the view's current transformation matrix to matrix.

Calls C++ function: void QGraphicsView::setMatrix(const QMatrix& matrix, bool combine = …).

C++ documentation:

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene; scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene); view.rotate(90); // the text is rendered with a 90 degree clockwise rotation view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordinate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also matrix(), setTransform(), rotate(), scale(), shear(), and translate().

pub unsafe fn set_matrix_1a(&self, matrix: impl CastInto<Ref<QMatrix>>)[src]

Sets the view's current transformation matrix to matrix.

Calls C++ function: void QGraphicsView::setMatrix(const QMatrix& matrix).

C++ documentation:

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene; scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene); view.rotate(90); // the text is rendered with a 90 degree clockwise rotation view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordinate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also matrix(), setTransform(), rotate(), scale(), shear(), and translate().

pub unsafe fn set_optimization_flag_2a(
    &self,
    flag: OptimizationFlag,
    enabled: bool
)
[src]

Enables flag if enabled is true; otherwise disables flag.

Calls C++ function: void QGraphicsView::setOptimizationFlag(QGraphicsView::OptimizationFlag flag, bool enabled = …).

C++ documentation:

Enables flag if enabled is true; otherwise disables flag.

See also optimizationFlags.

pub unsafe fn set_optimization_flag_1a(&self, flag: OptimizationFlag)[src]

Enables flag if enabled is true; otherwise disables flag.

Calls C++ function: void QGraphicsView::setOptimizationFlag(QGraphicsView::OptimizationFlag flag).

C++ documentation:

Enables flag if enabled is true; otherwise disables flag.

See also optimizationFlags.

pub unsafe fn set_optimization_flags(&self, flags: QFlags<OptimizationFlag>)[src]

flags that can be used to tune QGraphicsView's performance.

Calls C++ function: void QGraphicsView::setOptimizationFlags(QFlags<QGraphicsView::OptimizationFlag> flags).

C++ documentation:

flags that can be used to tune QGraphicsView's performance.

QGraphicsView uses clipping, extra bounding rect adjustments, and certain other aids to improve rendering quality and performance for the common case graphics scene. However, depending on the target platform, the scene, and the viewport in use, some of these operations can degrade performance.

The effect varies from flag to flag; see the OptimizationFlags documentation for details.

By default, no optimization flags are enabled.

This property was introduced in Qt 4.3.

Access functions:

OptimizationFlags optimizationFlags() const
void setOptimizationFlags(OptimizationFlags flags)

See also setOptimizationFlag().

pub unsafe fn set_render_hint_2a(&self, hint: RenderHint, enabled: bool)[src]

If enabled is true, the render hint hint is enabled; otherwise it is disabled.

Calls C++ function: void QGraphicsView::setRenderHint(QPainter::RenderHint hint, bool enabled = …).

C++ documentation:

If enabled is true, the render hint hint is enabled; otherwise it is disabled.

See also renderHints.

pub unsafe fn set_render_hint_1a(&self, hint: RenderHint)[src]

If enabled is true, the render hint hint is enabled; otherwise it is disabled.

Calls C++ function: void QGraphicsView::setRenderHint(QPainter::RenderHint hint).

C++ documentation:

If enabled is true, the render hint hint is enabled; otherwise it is disabled.

See also renderHints.

pub unsafe fn set_render_hints(&self, hints: QFlags<RenderHint>)[src]

This property holds the default render hints for the view

Calls C++ function: void QGraphicsView::setRenderHints(QFlags<QPainter::RenderHint> hints).

C++ documentation:

This property holds the default render hints for the view

These hints are used to initialize QPainter before each visible item is drawn. QPainter uses render hints to toggle rendering features such as antialiasing and smooth pixmap transformation.

QPainter::TextAntialiasing is enabled by default.

Example:

QGraphicsScene scene; scene.addRect(QRectF(-10, -10, 20, 20));

QGraphicsView view(&scene); view.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); view.show();

Access functions:

QPainter::RenderHints renderHints() const
void setRenderHints(QPainter::RenderHints hints)

pub unsafe fn set_resize_anchor(&self, anchor: ViewportAnchor)[src]

how the view should position the scene when the view is resized.

Calls C++ function: void QGraphicsView::setResizeAnchor(QGraphicsView::ViewportAnchor anchor).

C++ documentation:

how the view should position the scene when the view is resized.

QGraphicsView uses this property to decide how to position the scene in the viewport when the viewport widget's size changes. The default behavior, NoAnchor, leaves the scene's position unchanged during a resize; the top-left corner of the view will appear to be anchored while resizing.

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

Access functions:

ViewportAnchor resizeAnchor() const
void setResizeAnchor(ViewportAnchor anchor)

See also alignment and transformationAnchor.

pub unsafe fn set_rubber_band_selection_mode(&self, mode: ItemSelectionMode)[src]

This property holds the behavior for selecting items with a rubber band selection rectangle.

Calls C++ function: void QGraphicsView::setRubberBandSelectionMode(Qt::ItemSelectionMode mode).

C++ documentation:

This property holds the behavior for selecting items with a rubber band selection rectangle.

This property defines how items are selected when using the RubberBandDrag drag mode.

The default value is Qt::IntersectsItemShape; all items whose shape intersects with or is contained by the rubber band are selected.

This property was introduced in Qt 4.3.

Access functions:

Qt::ItemSelectionMode rubberBandSelectionMode() const
void setRubberBandSelectionMode(Qt::ItemSelectionMode mode)

See also dragMode, items(), and rubberBandRect().

pub unsafe fn set_scene(&self, scene: impl CastInto<Ptr<QGraphicsScene>>)[src]

Sets the current scene to scene. If scene is already being viewed, this function does nothing.

Calls C++ function: void QGraphicsView::setScene(QGraphicsScene* scene).

C++ documentation:

Sets the current scene to scene. If scene is already being viewed, this function does nothing.

When a scene is set on a view, the QGraphicsScene::changed() signal is automatically connected to this view's updateScene() slot, and the view's scroll bars are adjusted to fit the size of the scene.

The view does not take ownership of scene.

See also scene().

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

This property holds the area of the scene visualized by this view.

Calls C++ function: void QGraphicsView::setSceneRect(const QRectF& rect).

C++ documentation:

This property holds the area of the scene visualized by this view.

The scene rectangle defines the extent of the scene, and in the view's case, this means the area of the scene that you can navigate using the scroll bars.

If unset, or if a null QRectF is set, this property has the same value as QGraphicsScene::sceneRect, and it changes with QGraphicsScene::sceneRect. Otherwise, the view's scene rect is unaffected by the scene.

Note that, although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX). When the scene is larger than the scroll bars' values, you can choose to use translate() to navigate the scene instead.

By default, this property contains a rectangle at the origin with zero width and height.

Access functions:

QRectF sceneRect() const
void setSceneRect(const QRectF &rect)
void setSceneRect(qreal x, qreal y, qreal w, qreal h)

See also QGraphicsScene::sceneRect.

pub unsafe fn set_scene_rect_4a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double
)
[src]

This property holds the area of the scene visualized by this view.

Calls C++ function: void QGraphicsView::setSceneRect(double x, double y, double w, double h).

C++ documentation:

This property holds the area of the scene visualized by this view.

The scene rectangle defines the extent of the scene, and in the view's case, this means the area of the scene that you can navigate using the scroll bars.

If unset, or if a null QRectF is set, this property has the same value as QGraphicsScene::sceneRect, and it changes with QGraphicsScene::sceneRect. Otherwise, the view's scene rect is unaffected by the scene.

Note that, although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX). When the scene is larger than the scroll bars' values, you can choose to use translate() to navigate the scene instead.

By default, this property contains a rectangle at the origin with zero width and height.

Access functions:

QRectF sceneRect() const
void setSceneRect(const QRectF &rect)
void setSceneRect(qreal x, qreal y, qreal w, qreal h)

See also QGraphicsScene::sceneRect.

pub unsafe fn set_transform_2a(
    &self,
    matrix: impl CastInto<Ref<QTransform>>,
    combine: bool
)
[src]

Sets the view's current transformation matrix to matrix.

Calls C++ function: void QGraphicsView::setTransform(const QTransform& matrix, bool combine = …).

C++ documentation:

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene; scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene); view.rotate(90); // the text is rendered with a 90 degree clockwise rotation view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordiate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also transform(), rotate(), scale(), shear(), and translate().

pub unsafe fn set_transform_1a(&self, matrix: impl CastInto<Ref<QTransform>>)[src]

Sets the view's current transformation matrix to matrix.

Calls C++ function: void QGraphicsView::setTransform(const QTransform& matrix).

C++ documentation:

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene; scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene); view.rotate(90); // the text is rendered with a 90 degree clockwise rotation view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordiate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also transform(), rotate(), scale(), shear(), and translate().

pub unsafe fn set_transformation_anchor(&self, anchor: ViewportAnchor)[src]

how the view should position the scene during transformations.

Calls C++ function: void QGraphicsView::setTransformationAnchor(QGraphicsView::ViewportAnchor anchor).

C++ documentation:

how the view should position the scene during transformations.

QGraphicsView uses this property to decide how to position the scene in the viewport when the transformation matrix changes, and the coordinate system of the view is transformed. The default behavior, AnchorViewCenter, ensures that the scene point at the center of the view remains unchanged during transformations (e.g., when rotating, the scene will appear to rotate around the center of the view).

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

Access functions:

ViewportAnchor transformationAnchor() const
void setTransformationAnchor(ViewportAnchor anchor)

See also alignment and resizeAnchor.

pub unsafe fn set_viewport_update_mode(&self, mode: ViewportUpdateMode)[src]

how the viewport should update its contents.

Calls C++ function: void QGraphicsView::setViewportUpdateMode(QGraphicsView::ViewportUpdateMode mode).

C++ documentation:

how the viewport should update its contents.

QGraphicsView uses this property to decide how to update areas of the scene that have been reexposed or changed. Usually you do not need to modify this property, but there are some cases where doing so can improve rendering performance. See the ViewportUpdateMode documentation for specific details.

The default value is MinimalViewportUpdate, where QGraphicsView will update as small an area of the viewport as possible when the contents change.

This property was introduced in Qt 4.3.

Access functions:

ViewportUpdateMode viewportUpdateMode() const
void setViewportUpdateMode(ViewportUpdateMode mode)

See also ViewportUpdateMode and cacheMode.

pub unsafe fn shear(&self, sh: c_double, sv: c_double)[src]

Shears the current view transformation by (sh, sv).

Calls C++ function: void QGraphicsView::shear(double sh, double sv).

C++ documentation:

Shears the current view transformation by (sh, sv).

See also setTransform(), transform(), rotate(), scale(), and translate().

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

Reimplemented from QWidget::sizeHint().

Calls C++ function: virtual QSize QGraphicsView::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 tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

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

pub unsafe fn transform(&self) -> CppBox<QTransform>[src]

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

Calls C++ function: QTransform QGraphicsView::transform() const.

C++ documentation:

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

See also setTransform(), rotate(), scale(), shear(), and translate().

pub unsafe fn transformation_anchor(&self) -> ViewportAnchor[src]

how the view should position the scene during transformations.

Calls C++ function: QGraphicsView::ViewportAnchor QGraphicsView::transformationAnchor() const.

C++ documentation:

how the view should position the scene during transformations.

QGraphicsView uses this property to decide how to position the scene in the viewport when the transformation matrix changes, and the coordinate system of the view is transformed. The default behavior, AnchorViewCenter, ensures that the scene point at the center of the view remains unchanged during transformations (e.g., when rotating, the scene will appear to rotate around the center of the view).

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

Access functions:

ViewportAnchor transformationAnchor() const
void setTransformationAnchor(ViewportAnchor anchor)

See also alignment and resizeAnchor.

pub unsafe fn translate(&self, dx: c_double, dy: c_double)[src]

Translates the current view transformation by (dx, dy).

Calls C++ function: void QGraphicsView::translate(double dx, double dy).

C++ documentation:

Translates the current view transformation by (dx, dy).

See also setTransform(), transform(), rotate(), and shear().

pub unsafe fn update_scene(&self, rects: impl CastInto<Ref<QListOfQRectF>>)[src]

Schedules an update of the scene rectangles rects.

Calls C++ function: [slot] void QGraphicsView::updateScene(const QList<QRectF>& rects).

C++ documentation:

Schedules an update of the scene rectangles rects.

See also QGraphicsScene::changed().

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

Notifies QGraphicsView that the scene's scene rect has changed. rect is the new scene rect. If the view already has an explicitly set scene rect, this function does nothing.

Calls C++ function: [slot] void QGraphicsView::updateSceneRect(const QRectF& rect).

C++ documentation:

Notifies QGraphicsView that the scene's scene rect has changed. rect is the new scene rect. If the view already has an explicitly set scene rect, this function does nothing.

See also sceneRect and QGraphicsScene::sceneRectChanged().

pub unsafe fn viewport_transform(&self) -> CppBox<QTransform>[src]

Returns a matrix that maps scene coordinates to viewport coordinates.

Calls C++ function: QTransform QGraphicsView::viewportTransform() const.

C++ documentation:

Returns a matrix that maps scene coordinates to viewport coordinates.

See also mapToScene() and mapFromScene().

pub unsafe fn viewport_update_mode(&self) -> ViewportUpdateMode[src]

how the viewport should update its contents.

Calls C++ function: QGraphicsView::ViewportUpdateMode QGraphicsView::viewportUpdateMode() const.

C++ documentation:

how the viewport should update its contents.

QGraphicsView uses this property to decide how to update areas of the scene that have been reexposed or changed. Usually you do not need to modify this property, but there are some cases where doing so can improve rendering performance. See the ViewportUpdateMode documentation for specific details.

The default value is MinimalViewportUpdate, where QGraphicsView will update as small an area of the viewport as possible when the contents change.

This property was introduced in Qt 4.3.

Access functions:

ViewportUpdateMode viewportUpdateMode() const
void setViewportUpdateMode(ViewportUpdateMode mode)

See also ViewportUpdateMode and cacheMode.

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 QGraphicsView[src]

unsafe fn delete(&self)[src]

Destructs the QGraphicsView object.

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

C++ documentation:

Destructs the QGraphicsView object.

impl Deref for QGraphicsView[src]

type Target = QAbstractScrollArea

The resulting type after dereferencing.

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

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

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

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

impl DynamicCast<QGraphicsView> for QWidget[src]

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

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

impl DynamicCast<QGraphicsView> for QObject[src]

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

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

impl DynamicCast<QGraphicsView> for QPaintDevice[src]

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

Calls C++ function: QGraphicsView* dynamic_cast<QGraphicsView*>(QPaintDevice* 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<QGraphicsView> for QFrame[src]

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

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

impl StaticDowncast<QGraphicsView> for QWidget[src]

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

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

impl StaticDowncast<QGraphicsView> for QObject[src]

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

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

impl StaticDowncast<QGraphicsView> for QPaintDevice[src]

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

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

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

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

impl StaticUpcast<QObject> for QGraphicsView[src]

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

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

impl StaticUpcast<QPaintDevice> for QGraphicsView[src]

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

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

impl StaticUpcast<QWidget> for QGraphicsView[src]

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

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