Workspace 6.21.5
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
WorkspaceView Class Reference

#include <Workspace/Presentation/workspaceview.h>

Inheritance diagram for WorkspaceView:
[legend]

Public Types

enum  DragState {
  Undefined , RubberbandDrag , ItemDrag , OperationConnectorDrag ,
  OperationConnectorMovingDrag
}
 

Public Slots

void alignHorizontally ()
 
void alignVertically ()
 
void centerOnItem (const QGraphicsItem *item)
 
void clearSelection ()
 
void copyWorkspaceSelection ()
 
void createAnchor (const QPoint &pWidget)
 
void cutSelection ()
 
void deleteSelection ()
 
void deleteSharedGLWidget ()
 
void ensureCanScroll (const QPointF &deltaScene)
 
void expandSceneToViewport ()
 
void fitAll ()
 
void fitSelection ()
 
void nestedWorkspaceFromSelection ()
 
void pasteWorkspaceSelectionFromClipboard ()
 
void resetView (const QGraphicsItem *item=nullptr)
 
void resetView (const QPointF &p)
 
void scroll (int dx, int dy)
 
void setWorkspaceToolTip (const QString &toolTip)
 
void zoomIn ()
 
void zoomOut ()
 

Signals

void connectionArrowLocationChanged (int percent)
 
void fitAllCompleted ()
 
void hideUnpinnedRacks ()
 
void refreshVisibility (bool visible)
 
void requestDisplayNestedWorkflowContents (CSIRO::DataExecution::Workspace *ws)
 
void requestShowOperationInWorkflowTree (CSIRO::DataExecution::Operation *op)
 
void scrolledBy (int dx, int dy)
 
void statusBarMessage (const QString &msg)
 
void unpinAndHideRacks ()
 
void viewportTransformChanged (const QMatrix &transform)
 

Public Member Functions

 WorkspaceView (WorkspaceScene &scene, QWidget *parent=nullptr, bool initFocusOnSelection=false)
 
 ~WorkspaceView () override
 
void checkLabelVisibility (bool visible)
 
void clearAll ()
 
QPointF getClickPoint () const
 
ConnectionViewgetConnectionView (const DataExecution::Connection &con) const
 
WorkspaceView::DragState getDragState ()
 
QPoint getRubberBandClick ()
 
QRubberBand * getRubberBandTool ()
 
DataExecution::WorkspacegetWorkspace ()
 
WorkspaceScenegetWorkspaceScene ()
 
QString getWorkspaceToolTip () const
 
void hideAllUnpinnedRacks ()
 
void resetOperationGraphics ()
 
void saveViewExtras ()
 
void selectAll ()
 
void setDragState (WorkspaceView::DragState dragState)
 
void setRubberBandClick (QPoint click)
 
void showStatusBarMessage (const QString &msg)
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 

Static Public Member Functions

static bool getUseGL ()
 
static void setUseGL (bool enable)
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void focusInEvent (QFocusEvent *event) override
 
void focusOutEvent (QFocusEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void keyReleaseEvent (QKeyEvent *event) override
 
void leaveEvent (QEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 
void scrollContentsBy (int dx, int dy) override
 
void wheelEvent (QWheelEvent *event) override
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Member Enumeration Documentation

◆ DragState

enum DragState
Enumerator
Undefined 
RubberbandDrag 
ItemDrag 
OperationConnectorDrag 
OperationConnectorMovingDrag 

Constructor & Destructor Documentation

◆ WorkspaceView()

WorkspaceView ( WorkspaceScene scene,
QWidget *  parent = nullptr,
bool  initFocusOnSelection = false 
)
Parameters
sceneThe scene that this view will be viewing.
parentThe parent widget for this view. A QScrollArea is usually a good idea as a parent so that a large workspace can be more easily navigated by the user.
initFocusOnSelectionSets a flag that to focus on selected items on the first paint event.

◆ ~WorkspaceView()

~WorkspaceView ( )
override

Member Function Documentation

◆ alignHorizontally

void alignHorizontally ( )
slot

◆ alignVertically

void alignVertically ( )
slot

◆ centerOnItem

void centerOnItem ( const QGraphicsItem *  item)
slot

◆ checkLabelVisibility()

void checkLabelVisibility ( bool  visible)

◆ clearAll()

void clearAll ( )

Remove all workspace views and the workspace elements they represent. The end result is an empty workspace.

◆ clearSelection

void clearSelection ( )
slot

Clears the selection for this workspace view.

◆ connectionArrowLocationChanged

void connectionArrowLocationChanged ( int  percent)
signal

◆ contextMenuEvent()

void contextMenuEvent ( QContextMenuEvent *  event)
overrideprotected

◆ copyWorkspaceSelection

void copyWorkspaceSelection ( )
slot

Copies the selection in the view onto the clipboard. This function is usually a precursor to calling pasteWorkspaceSelectionFromClipboard(), probably into a different view.

See also
cutSelection(), pasteWorkspaceSelectionFromClipboard()

◆ createAnchor

void createAnchor ( const QPoint &  pWidget)
slot
Parameters
pWidgetThe location in the widget's local co-ordinates at which a new connection anchor should be created. This will be automatically translated into scene co-ordinates.
Note
This function creates the anchor as an undoable command.

◆ cutSelection

void cutSelection ( )
slot

Copies the selection in the view onto the clipboard and then deletes the selection. This function is usually a precursor to calling pasteWorkspaceSelectionFromClipboard(), probably into a different view.

See also
copyWorkspaceSelection(), pasteWorkspaceSelectionFromClipboard()

◆ deleteSelection

void deleteSelection ( )
slot

Deletes all selected operations.

◆ deleteSharedGLWidget

void deleteSharedGLWidget ( )
slot

◆ dragLeaveEvent()

void dragLeaveEvent ( QDragLeaveEvent *  event)
overrideprotected

◆ dragMoveEvent()

void dragMoveEvent ( QDragMoveEvent *  event)
overrideprotected

◆ ensureCanScroll

void ensureCanScroll ( const QPointF &  deltaScene)
slot

◆ expandSceneToViewport

void expandSceneToViewport ( )
slot

Whenever an operation is dropped on the view, the scene needs to expand to account for that operation's location in scene coordinates.

◆ fitAll

void fitAll ( )
slot

◆ fitAllCompleted

void fitAllCompleted ( )
signal

◆ fitSelection

void fitSelection ( )
slot

◆ focusInEvent()

void focusInEvent ( QFocusEvent *  event)
overrideprotected

◆ focusOutEvent()

void focusOutEvent ( QFocusEvent *  event)
overrideprotected

Improving consistency of UI

◆ getClickPoint()

QPointF getClickPoint ( ) const

◆ getConnectionView()

ConnectionView * getConnectionView ( const DataExecution::Connection con) const
Parameters
conA Connection that must be in the workspace this WorkspaceView represents. An assertion will be triggered if this condition is violated in a debug build.
Returns
This workspace view's ConnectionView for con, or a null pointer if con is not in this workspace view's workspace (for non-debug builds).

◆ getDragState()

WorkspaceView::DragState getDragState ( )

◆ getRubberBandClick()

QPoint getRubberBandClick ( )

◆ getRubberBandTool()

QRubberBand * getRubberBandTool ( )

◆ getUseGL()

bool getUseGL ( )
static
See also
setUseGL()

◆ getWorkspace()

Workspace & getWorkspace ( )
Returns
The workspace this workspace view represents.

◆ getWorkspaceScene()

WorkspaceScene & getWorkspaceScene ( )
Returns
The workspace scene used internally to represent the workspace.
Note
This function exists mostly for the benefit of the graphics scene widget subclasses which are used to represent operations and connections. Other client code would not normally call this function.

◆ getWorkspaceToolTip()

QString getWorkspaceToolTip ( ) const

◆ hideAllUnpinnedRacks()

void hideAllUnpinnedRacks ( )

◆ hideUnpinnedRacks

void hideUnpinnedRacks ( )
signal

◆ keyPressEvent()

void keyPressEvent ( QKeyEvent *  event)
overrideprotected

◆ keyReleaseEvent()

void keyReleaseEvent ( QKeyEvent *  event)
overrideprotected

◆ leaveEvent()

void leaveEvent ( QEvent *  event)
overrideprotected

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

3 options, hand-drag, rubber-band selection and item(s) drag auto-scrolling

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent *  event)
overrideprotected

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Added to implement auto-scrolling functionality in Impl class

◆ nestedWorkspaceFromSelection

void nestedWorkspaceFromSelection ( )
slot

Converts the currently selected operations into a nested workspace. If no operations are currently selected in the workspace this WorkspaceView represents, calling this function will have no effect.

◆ paintEvent()

void paintEvent ( QPaintEvent *  event)
overrideprotected

◆ pasteWorkspaceSelectionFromClipboard

void pasteWorkspaceSelectionFromClipboard ( )
slot

Pastes the current contents of the clipboard into the workspace this view is associated with.

See also
cutSelection(), copyWorkspaceSelection()

◆ refreshVisibility

void refreshVisibility ( bool  visible)
signal

◆ requestDisplayNestedWorkflowContents

void requestDisplayNestedWorkflowContents ( CSIRO::DataExecution::Workspace ws)
signal

◆ requestShowOperationInWorkflowTree

void requestShowOperationInWorkflowTree ( CSIRO::DataExecution::Operation op)
signal

◆ resetOperationGraphics()

void resetOperationGraphics ( )

◆ resetView [1/2]

void resetView ( const QGraphicsItem *  item = nullptr)
slot
Parameters
itemThe scene item to put as close to the center of the view as possible after the zoom factor has been reset to 1. If this is a null pointer, the center of the bounding box around all the scene items will be centered instead.

◆ resetView [2/2]

void resetView ( const QPointF &  p)
slot
Parameters
pThe point to put as close to the center of the view as possible after the zoom factor has been reset to 1.

◆ saveViewExtras()

void saveViewExtras ( )

Calling this function causes all workspace element widgets contained by this workspace view to save their view information. Note that it does not save the information of this workspace's own view if it is nested inside another.

◆ scroll

void scroll ( int  dx,
int  dy 
)
slot

◆ scrollContentsBy()

void scrollContentsBy ( int  dx,
int  dy 
)
overrideprotected

◆ scrolledBy

void scrolledBy ( int  dx,
int  dy 
)
signal

◆ selectAll()

void selectAll ( )

◆ setDragState()

void setDragState ( WorkspaceView::DragState  dragState)

◆ setRubberBandClick()

void setRubberBandClick ( QPoint  click)

◆ setUseGL()

void setUseGL ( bool  enable)
static
Parameters
enableIf true, then all subsequently created workspace tabs will use QGLWidget as their viewport. This can lead to significant performance improvement, but it can also trigger various bugs in Qt's QGrahpicsView classes. This option is currently considered experimental.
See also
getUseGL()

◆ setWorkspaceToolTip

void setWorkspaceToolTip ( const QString &  toolTip)
slot

◆ showStatusBarMessage()

void showStatusBarMessage ( const QString &  msg)
inline

◆ statusBarMessage

void statusBarMessage ( const QString &  msg)
signal

◆ unpinAndHideRacks

void unpinAndHideRacks ( )
signal

◆ viewportTransformChanged

void viewportTransformChanged ( const QMatrix &  transform)
signal

◆ wheelEvent()

void wheelEvent ( QWheelEvent *  event)
overrideprotected

◆ zoomIn

void zoomIn ( )
slot

◆ zoomOut

void zoomOut ( )
slot