Class: QgsModelGraphicsView

class qgis.gui.QgsModelGraphicsView

Bases: PyQt5.QtWidgets.QGraphicsView

QGraphicsView subclass representing the model designer.

Warning

Not stable API

New in version 3.14.

QgsModelGraphicsView(parent: QWidget = None) Constructor for QgsModelGraphicsView, with the specified parent widget.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

copyItems

Cuts or copies the a list of items, respecting the specified operation.

copySelectedItems

Cuts or copies the selected items, respecting the specified operation.

create

customEvent

destroy

disconnectNotify

dragEnterEvent

param event:

dragLeaveEvent

dragMoveEvent

param event:

drawBackground

drawForeground

drawFrame

dropEvent

param event:

endMacroCommand

Ends a macro command, containing a group of interactions in the view.

enterEvent

event

eventFilter

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

param event:

keyReleaseEvent

param event:

leaveEvent

metric

modelScene

Returns the scene associated with the tool.

mouseDoubleClickEvent

param event:

mouseMoveEvent

param event:

mousePressEvent

param event:

mouseReleaseEvent

param event:

moveEvent

nativeEvent

paintEvent

pasteItems

Pastes items from clipboard, using the specified mode.

receivers

resizeEvent

scrollContentsBy

sender

senderSignalIndex

setModelScene

Sets the related scene.

setViewportMargins

setupViewport

sharedPainter

showEvent

snapSelected

Snaps the selected items to the grid.

startMacroCommand

Starts a macro command, containing a group of interactions in the view.

tabletEvent

timerEvent

updateMicroFocus

viewportEvent

viewportMargins

viewportSizeHint

wheelEvent

param event:

Signals

algorithmDropped

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

beginCommand

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

deleteSelectedItems

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

endCommand

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

inputDropped

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

itemFocused

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

macroCommandEnded

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

macroCommandStarted

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

willBeDeleted

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

ClipboardCopy

ClipboardCut

PasteModeCenter

PasteModeCursor

PasteModeInPlace

ClipboardCopy = 1
ClipboardCut = 0
class ClipboardOperation

Bases: int

class PasteMode

Bases: int

PasteModeCenter = 1
PasteModeCursor = 0
PasteModeInPlace = 2
actionEvent(self, QActionEvent)
algorithmDropped

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

beginCommand

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
copyItems(self, items: Iterable[QgsModelComponentGraphicItem], operation: QgsModelGraphicsView.ClipboardOperation)

Cuts or copies the a list of items, respecting the specified operation.

See also

pasteItems()

Parameters:
copySelectedItems(self, operation: QgsModelGraphicsView.ClipboardOperation)

Cuts or copies the selected items, respecting the specified operation.

See also

copyItems()

See also

pasteItems()

Parameters:

operation (QgsModelGraphicsView.ClipboardOperation) –

create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
deleteSelectedItems

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, event: QDragEnterEvent)
Parameters:

event (QDragEnterEvent) –

dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, event: QDragMoveEvent)
Parameters:

event (QDragMoveEvent) –

drawBackground(self, QPainter, QRectF)
drawForeground(self, QPainter, QRectF)
drawFrame(self, QPainter)
dropEvent(self, event: QDropEvent)
Parameters:

event (QDropEvent) –

endCommand

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

endMacroCommand(self)

Ends a macro command, containing a group of interactions in the view.

enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionFrame)
inputDropped

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
itemFocused

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

keyPressEvent(self, event: QKeyEvent)
Parameters:

event (QKeyEvent) –

keyReleaseEvent(self, event: QKeyEvent)
Parameters:

event (QKeyEvent) –

leaveEvent(self, QEvent)
macroCommandEnded

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

macroCommandStarted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

metric(self, QPaintDevice.PaintDeviceMetric) int
modelScene(self) QgsModelGraphicsScene

Returns the scene associated with the tool.

See also

view()

Return type:

QgsModelGraphicsScene

mouseDoubleClickEvent(self, event: QMouseEvent)
Parameters:

event (QMouseEvent) –

mouseMoveEvent(self, event: QMouseEvent)
Parameters:

event (QMouseEvent) –

mousePressEvent(self, event: QMouseEvent)
Parameters:

event (QMouseEvent) –

mouseReleaseEvent(self, event: QMouseEvent)
Parameters:

event (QMouseEvent) –

moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
pasteItems(self, mode: QgsModelGraphicsView.PasteMode)

Pastes items from clipboard, using the specified mode.

See also

hasItemsInClipboard()

Parameters:

mode (QgsModelGraphicsView.PasteMode) –

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
QgsModelGraphicsView.scrollContentsBy(self, int, int)
sender(self) QObject
senderSignalIndex(self) int
setModelScene(self, scene: QgsModelGraphicsScene)

Sets the related scene.

Parameters:

scene (QgsModelGraphicsScene) –

QgsModelGraphicsView.setViewportMargins(self, int, int, int, int)
setViewportMargins(self, QMargins) None
setupViewport(self, QWidget)
sharedPainter(self) QPainter
showEvent(self, QShowEvent)
snapSelected(self)

Snaps the selected items to the grid.

startMacroCommand(self, text: str)

Starts a macro command, containing a group of interactions in the view.

Parameters:

text (str) –

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
viewportEvent(self, QEvent) bool
viewportMargins(self) QMargins
viewportSizeHint(self) QSize
wheelEvent(self, event: QWheelEvent)
Parameters:

event (QWheelEvent) –

willBeDeleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL