Skip to content

PythonQt.QtGui.QGraphicsView · declarations 001

Back to PythonQt.QtGui.QGraphicsView

AnchorUnderMouse instance-attribute

AnchorUnderMouse: Any

AnchorViewCenter instance-attribute

AnchorViewCenter: Any

BoundingRectViewportUpdate instance-attribute

BoundingRectViewportUpdate: Any

CacheBackground instance-attribute

CacheBackground: Any

CacheModeFlag instance-attribute

CacheModeFlag: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

CacheNone instance-attribute

CacheNone: Any

DontAdjustForAntialiasing instance-attribute

DontAdjustForAntialiasing: Any

DontClipPainter instance-attribute

DontClipPainter: Any

DontSavePainterState instance-attribute

DontSavePainterState: Any

DragMode instance-attribute

DragMode: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

FullViewportUpdate instance-attribute

FullViewportUpdate: Any

IndirectPainting instance-attribute

IndirectPainting: Any

MinimalViewportUpdate instance-attribute

MinimalViewportUpdate: Any

NoAnchor instance-attribute

NoAnchor: Any

NoDrag instance-attribute

NoDrag: Any

NoViewportUpdate instance-attribute

NoViewportUpdate: Any

OptimizationFlag instance-attribute

OptimizationFlag: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

OptimizationFlags instance-attribute

OptimizationFlags: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

RubberBandDrag instance-attribute

RubberBandDrag: Any

ScrollHandDrag instance-attribute

ScrollHandDrag: Any

SmartViewportUpdate instance-attribute

SmartViewportUpdate: Any

ViewportAnchor instance-attribute

ViewportAnchor: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

ViewportUpdateMode instance-attribute

ViewportUpdateMode: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

alignment instance-attribute

alignment: Any

Qt 5 reference:

alignment : Qt::Alignment

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)

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#alignment

backgroundBrush instance-attribute

backgroundBrush: QBrush

Qt 5 reference:

backgroundBrush : QBrush

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.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#backgroundBrush

cacheMode instance-attribute

cacheMode: Any

Qt 5 reference:

cacheMode : CacheMode

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:

QGraphicsView::CacheMode cacheMode() const
void setCacheMode(QGraphicsView::CacheMode mode)

See also resetCachedContent() and QPixmapCache.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#cacheMode

centerOn

centerOn(x: Any, y: Any) -> None

X.centerOn(x, y)

Supplemental documentation: Qt 5 reference:

void QGraphicsView::centerOn(const QPointF \&pos)

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

void QGraphicsView::centerOn(qreal x, qreal y)

This is an overloaded function.

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

void QGraphicsView::centerOn(const QGraphicsItem *item)

This is an overloaded function.

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

See also ensureVisible().

Upstream PySide2 reference signatures (binding differences may apply):

centerOn(self, item: PySide2.QtWidgets.QGraphicsItem) -> None
centerOn(self, pos: PySide2.QtCore.QPointF) -> None
centerOn(self, x: float, y: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#centerOn

contextMenuEvent

contextMenuEvent(event: Any) -> None

X.contextMenuEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsView::contextMenuEvent(QContextMenuEvent *event)

Reimplements: QAbstractScrollArea::contextMenuEvent(QContextMenuEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

contextMenuEvent(self, event: PySide2.QtGui.QContextMenuEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#contextMenuEvent

customContextMenuRequested

customContextMenuRequested(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QGraphicsView.customContextMenuRequested; argument details are not documented.

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QGraphicsView.destroyed; argument details are not documented.

dragEnterEvent

dragEnterEvent(event: Any) -> None

X.dragEnterEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsView::dragEnterEvent(QDragEnterEvent *event)

Reimplements: QAbstractScrollArea::dragEnterEvent(QDragEnterEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragEnterEvent(self, event: PySide2.QtGui.QDragEnterEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#dragEnterEvent

dragLeaveEvent

dragLeaveEvent(event: Any) -> None

X.dragLeaveEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsView::dragLeaveEvent(QDragLeaveEvent *event)

Reimplements: QAbstractScrollArea::dragLeaveEvent(QDragLeaveEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragLeaveEvent(self, event: PySide2.QtGui.QDragLeaveEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#dragLeaveEvent

dragMode instance-attribute

dragMode: Any

Qt 5 reference:

dragMode : DragMode

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:

QGraphicsView::DragMode dragMode() const
void setDragMode(QGraphicsView::DragMode mode)

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#dragMode

dragMoveEvent

dragMoveEvent(event: Any) -> None

X.dragMoveEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsView::dragMoveEvent(QDragMoveEvent *event)

Reimplements: QAbstractScrollArea::dragMoveEvent(QDragMoveEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dragMoveEvent(self, event: PySide2.QtGui.QDragMoveEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#dragMoveEvent

drawBackground

drawBackground(painter: Any, rect: Any) -> None

X.drawBackground(painter, rect)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsView::drawBackground(QPainter *painter, const QRectF \&rect)

Draws the background of the scene using painter, before any items and the foreground are drawn. Reimplement this function to provide a custom background for this view.

If all you want is to define a color, texture or gradient for the background, you can call setBackgroundBrush() instead.

All painting is done in scene coordinates. rect is the exposed rectangle.

The default implementation fills rect using the view's backgroundBrush. If no such brush is defined (the default), the scene's drawBackground() function is called instead.

See also drawForeground() and QGraphicsScene::drawBackground().

Upstream PySide2 reference signatures (binding differences may apply):

drawBackground(self, painter: PySide2.QtGui.QPainter, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#drawBackground

drawForeground

drawForeground(painter: Any, rect: Any) -> None

X.drawForeground(painter, rect)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsView::drawForeground(QPainter *painter, const QRectF \&rect)

Draws the foreground of the scene using painter, after the background and all items are drawn. Reimplement this function to provide a custom foreground for this view.

If all you want is to define a color, texture or gradient for the foreground, you can call setForegroundBrush() instead.

All painting is done in scene coordinates. rect is the exposed rectangle.

The default implementation fills rect using the view's foregroundBrush. If no such brush is defined (the default), the scene's drawForeground() function is called instead.

See also drawBackground() and QGraphicsScene::drawForeground().

Upstream PySide2 reference signatures (binding differences may apply):

drawForeground(self, painter: PySide2.QtGui.QPainter, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#drawForeground

drawItems

drawItems(painter: Any, numItems: int, items: Any, options: Any) -> None

X.drawItems(painter, numItems, items, options)

Upstream PySide2 reference signatures (binding differences may apply):

drawItems(self, painter: PySide2.QtGui.QPainter, numItems: int, items: typing.Sequence[PySide2.QtWidgets.QGraphicsItem], options: typing.Sequence[PySide2.QtWidgets.QStyleOptionGraphicsItem]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#drawItems

dropEvent

dropEvent(event: Any) -> None

X.dropEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QGraphicsView::dropEvent(QDropEvent *event)

Reimplements: QAbstractScrollArea::dropEvent(QDropEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

dropEvent(self, event: PySide2.QtGui.QDropEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#dropEvent

ensureVisible

ensureVisible(x: Any, y: Any, w: Any, h: Any, xmargin: int, ymargin: int) -> None

X.ensureVisible(x, y, w, h, xmargin, ymargin)

Supplemental documentation: Qt 5 reference:

void QGraphicsView::ensureVisible(const QRectF \&rect, int xmargin \= 50, int ymargin \= 50)

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

void QGraphicsView::ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin \= 50, int ymargin \= 50)

This is an overloaded function.

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

void QGraphicsView::ensureVisible(const QGraphicsItem *item, int xmargin \= 50, int ymargin \= 50)

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

Upstream PySide2 reference signatures (binding differences may apply):

ensureVisible(self, item: PySide2.QtWidgets.QGraphicsItem, xmargin: int=..., ymargin: int=...) -> None
ensureVisible(self, rect: PySide2.QtCore.QRectF, xmargin: int=..., ymargin: int=...) -> None
ensureVisible(self, x: float, y: float, w: float, h: float, xmargin: int=..., ymargin: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#ensureVisible

event

event(event: Any) -> bool

X.event(event) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QGraphicsView::event(QEvent *event)

Reimplements: QAbstractScrollArea::event(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, event: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsview.html#event