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

Tab widget for editing workspaces. More...

#include <Workspace/Presentation/workspacetabwidget.h>

Inherits QWidget.

Public Slots

void alignHorizontally ()
 
void alignVertically ()
 
void closeTab (int index)
 
void copy ()
 
void createAnchor (const QPoint &p)
 
void cut ()
 
void dimOperationsChanged (bool isChecked)
 
bool getProgressBarsCanUpdate () const
 
void nextTab ()
 
void notifyDependencyVisibilityPolicyChanged ()
 
void notifyMiniOperationVisibilityPolicyChanged ()
 
void onConnectionSelectionChanged (const CSIRO::DataExecution::Connection &connection, bool selected)
 
void onNoteSelectionChanged (const QUuid &wspId, const QUuid &id, bool selected)
 
void paste ()
 
void previousTab ()
 
void scroll (int dx, int dy)
 
void selectAll ()
 
void setConnectionArrowLocation (int)
 
void setController (CSIRO::Presentation::WorkspaceController *controller)
 
void setCurrentIndex (int index)
 
void setGraphicsEffectFactory (const WorkspaceGraphicsEffectFactory &graphicsEffectFactory)
 
void setGridSpacing (int spacing)
 
void setSceneRect (const QRectF &rect)
 
void setUsingGrid (bool enabled)
 
void setViewportTransform (const QMatrix &transform)
 
void showHelp ()
 
void showIOBase (DataExecution::IOBase &iobase, bool centerOnOp=true)
 
void showOperation (const QString &operationIdPath, bool centerOnOp=true)
 
void showOperation (CSIRO::DataExecution::Operation &operation, bool centerOnOp=true)
 
void showTab (CSIRO::DataExecution::Workspace *workspace)
 
void toggleOpProgressBars (bool isChecked)
 
void zoomFitAll ()
 
void zoomFitSelection ()
 
void zoomIn ()
 
void zoomOut ()
 
void zoomReset ()
 

Signals

void connectionSelectionChanged (const CSIRO::DataExecution::Connection &connection, bool selected)
 
void currentChanged (CSIRO::DataExecution::Workspace *workspace)
 
void currentChanged (int index)
 
void dependencyVisibilityPolicyChanged ()
 
void fitAllCompleted ()
 
void gridSpacingChanged (int spacing)
 
void noteSelectionChanged (const QUuid &wspId, const QUuid &noteItemId, bool selected)
 
void operationDimmedStatusChanged ()
 
void opProgressBarsToggled (bool isChecked)
 
void progressBarsCanUpdate (bool visible)
 
void requestOpenWorkflow (const QString &filePath)
 
void rootTabClosed ()
 
void sceneRectChanged (const QRectF &rect)
 
void scrolledBy (int dx, int dy)
 
void statusBarText (const QString &msg)
 
void usingGrid (bool enabled)
 
void viewportTransformChanged (const QMatrix &transform)
 
void workspaceInputOutputVariableVisibilityPolicyChanged ()
 

Public Member Functions

 WorkspaceTabWidget (QWidget *parent=nullptr)
 
 WorkspaceTabWidget (WorkspaceController &controller, const WorkspaceGraphicsEffectFactory &graphicsEffectFactory=StandardWorkspaceGraphicsEffectFactory::getInstance(), QWidget *parent=nullptr)
 
 ~WorkspaceTabWidget () override
 
int count () const
 
int currentIndex () const
 
WorkspaceControllergetController ()
 
int getGridSpacing () const
 
int getTab (const DataExecution::Workspace &workspace)
 
QGraphicsView::ViewportAnchor getViewportTransformAnchor () const
 
DataExecution::WorkspacegetWorkspace (int index)
 
bool isReadOnly () const
 
bool isSuppressingConnectionWarnings ()
 
bool isUsingExtendedSelection ()
 
bool isUsingGrid () const
 
bool isUsingPlaceholderGraphics () const
 
void saveViewExtras ()
 
void setReadOnly (bool b)
 
void setSuppressingConnectionWarnings (bool b) const
 
void setUsingExtendedSelection (bool b) const
 
void setUsingPlaceholderGraphics (bool b)
 
void setViewportTransformAnchor (QGraphicsView::ViewportAnchor anchor)
 

Static Public Member Functions

static bool connectViewportInteractions (QList< WorkspaceTabWidget * > widgetList)
 
static bool connectViewportInteractions (WorkspaceTabWidget *widgetA, WorkspaceTabWidget *widgetB)
 
static bool disconnectViewportInteractions (QList< WorkspaceTabWidget * > widgetList)
 
static bool disconnectViewportInteractions (WorkspaceTabWidget *widgetA, WorkspaceTabWidget *widgetB)
 

Protected Member Functions

void hideEvent (QHideEvent *event) override
 
void showEvent (QShowEvent *event) override
 

Properties

int count
 
int currentIndex
 
int gridSpacing
 
bool progressBarsUpdatable
 
bool useGrid
 

Detailed Description

This widget does not derive from QTabWidget. This is because, while it looks like a QTabWidget and is implemented in terms of a QTabWidget, it does not support the full functionality and behaviour of a QTabWidget. Specifically, when a tab is removed from a QTabWidget, the QTabWidget::removeTab() function does not delete the widget the tab contains, whereas the WorkspaceTabWidget needs to rigorously enforce that the widget within a tab is deleted when the tab is closed. Also, a WorkspaceTabWidget only supports tabs containing a specific type of widget (which is an internal widget type, so no direct/public access to the tab's widget is permitted). What all this means for clients of this class is that you should treat it not like a QTabWidget, but rather as a new type of widget which has its own public interface. Its behaviour will be similar to that of a QTabWidget and it will look like a QTabWidget, but that should be considered more a coincidence than a requirement.

Constructor & Destructor Documentation

◆ WorkspaceTabWidget() [1/2]

WorkspaceTabWidget ( WorkspaceController controller,
const WorkspaceGraphicsEffectFactory graphicsEffectFactory = StandardWorkspaceGraphicsEffectFactory::getInstance(),
QWidget *  parent = nullptr 
)

◆ WorkspaceTabWidget() [2/2]

WorkspaceTabWidget ( QWidget *  parent = nullptr)

◆ ~WorkspaceTabWidget()

~WorkspaceTabWidget ( )
override

Member Function Documentation

◆ alignHorizontally

void alignHorizontally ( )
slot

◆ alignVertically

void alignVertically ( )
slot

◆ closeTab

void closeTab ( int  index)
slot
Parameters
indexThe index of the tab to close.

The root tab is treated specially. A request to close the root tab results in a rootTabClosed() signal being emitted, but it is up to something else to act on that signal. The WorkspaceTabWidget will not close the root tab except if the workspace it represents is deleted (which should only happen when the WorkspaceController this tab widget is attached to has its setWorkspace() function called.

◆ connectionSelectionChanged

void connectionSelectionChanged ( const CSIRO::DataExecution::Connection connection,
bool  selected 
)
signal

◆ connectViewportInteractions() [1/2]

bool connectViewportInteractions ( QList< WorkspaceTabWidget * >  widgetList)
static

◆ connectViewportInteractions() [2/2]

bool connectViewportInteractions ( WorkspaceTabWidget widgetA,
WorkspaceTabWidget widgetB 
)
static
Parameters
widgetAThe first widget to connect.
widgetBThe second widget to connect
Returns
true if the connection was successful, false otherwise.

Connects the interactions of two tab widgets. Panning, opening nested workflows etc.

◆ copy

void copy ( )
slot

◆ count()

int count ( ) const

◆ createAnchor

void createAnchor ( const QPoint &  p)
slot
Parameters
pThe point at which to create a new anchor. Note that p is in the tab widget's local co-ordinates. This will be automatically translated to the appropriate co-ordinates within the currently shown tab.
Note
This function creates the anchor as an undoable command.

◆ currentChanged [1/2]

void currentChanged ( CSIRO::DataExecution::Workspace workspace)
signal

◆ currentChanged [2/2]

void currentChanged ( int  index)
signal

◆ currentIndex()

int currentIndex ( ) const

◆ cut

void cut ( )
slot

◆ dependencyVisibilityPolicyChanged

void dependencyVisibilityPolicyChanged ( )
signal

◆ dimOperationsChanged

void dimOperationsChanged ( bool  isChecked)
slot

Dims or restores all the operation icons

◆ disconnectViewportInteractions() [1/2]

bool disconnectViewportInteractions ( QList< WorkspaceTabWidget * >  widgetList)
static

◆ disconnectViewportInteractions() [2/2]

bool disconnectViewportInteractions ( WorkspaceTabWidget widgetA,
WorkspaceTabWidget widgetB 
)
static
Parameters
widgetAThe first widget to connect.
widgetBThe second widget to connect
Returns
true if the connection was successful, false otherwise.

Disconnects the interactions of two tab widgets, making them independent once more.

◆ fitAllCompleted

void fitAllCompleted ( )
signal

◆ getController()

WorkspaceController * getController ( )

◆ getGridSpacing()

int getGridSpacing ( ) const
Returns
The current grid spacing. Note that the grid might still be disabled even if a positive value is returned for the spacing. Indeed, the spacing and whether or not the grid is used are two different properties and are stored separately.
See also
setGridSpacing(), isUsingGrid(), setUsingGrid()

◆ getProgressBarsCanUpdate

bool getProgressBarsCanUpdate ( ) const
slot

◆ getTab()

int getTab ( const DataExecution::Workspace workspace)

◆ getViewportTransformAnchor()

QGraphicsView::ViewportAnchor getViewportTransformAnchor ( ) const

◆ getWorkspace()

DataExecution::Workspace * getWorkspace ( int  index)
Parameters
indexThe index of the tab to find. It must not be negative and it must be less than the number of tabs in the tab widget (ie less than the value returned by count()).
Returns
The Workspace that corresponds to the specified index. The index may lead to a tab that is not viewing a Workspace in which case a nullptr will be returned.

◆ gridSpacingChanged

void gridSpacingChanged ( int  spacing)
signal

◆ hideEvent()

void hideEvent ( QHideEvent *  event)
overrideprotected

When the widget is hidden, the progress bars will not need to be updated, so this function disables those updates. This will result in a progressBarsCanUpdate() signal being emitted.

See also
showEvent()

◆ isReadOnly()

bool isReadOnly ( ) const

◆ isSuppressingConnectionWarnings()

bool isSuppressingConnectionWarnings ( )
Returns
true if the widget is being used by a tool rather than the workspace editor

◆ isUsingExtendedSelection()

bool isUsingExtendedSelection ( )
Returns
true if selection changes should be triggered by connections and notes (and ?)

◆ isUsingGrid()

bool isUsingGrid ( ) const
Returns
True if snap to grid is currently enabled.
See also
setUsingGrid(), setGridSpacing(), getGridSpacing()

◆ isUsingPlaceholderGraphics()

bool isUsingPlaceholderGraphics ( ) const

◆ nextTab

void nextTab ( )
slot

◆ noteSelectionChanged

void noteSelectionChanged ( const QUuid &  wspId,
const QUuid &  noteItemId,
bool  selected 
)
signal

◆ notifyDependencyVisibilityPolicyChanged

void notifyDependencyVisibilityPolicyChanged ( )
slot

◆ notifyMiniOperationVisibilityPolicyChanged

void notifyMiniOperationVisibilityPolicyChanged ( )
slot

◆ onConnectionSelectionChanged

void onConnectionSelectionChanged ( const CSIRO::DataExecution::Connection connection,
bool  selected 
)
slot

◆ onNoteSelectionChanged

void onNoteSelectionChanged ( const QUuid &  wspId,
const QUuid &  id,
bool  selected 
)
slot

◆ operationDimmedStatusChanged

void operationDimmedStatusChanged ( )
signal

◆ opProgressBarsToggled

void opProgressBarsToggled ( bool  isChecked)
signal

◆ paste

void paste ( )
slot

◆ previousTab

void previousTab ( )
slot

◆ progressBarsCanUpdate

void progressBarsCanUpdate ( bool  visible)
signal

◆ requestOpenWorkflow

void requestOpenWorkflow ( const QString &  filePath)
signal

◆ rootTabClosed

void rootTabClosed ( )
signal

◆ saveViewExtras()

void saveViewExtras ( )

◆ sceneRectChanged

void sceneRectChanged ( const QRectF &  rect)
signal

◆ scroll

void scroll ( int  dx,
int  dy 
)
slot
Parameters
dxDelta in the x-dimension (in pixels)
dyDelta in the y-dimension (in pixels)

Scrolls the current view within the WorkspaceTabWidget by the specified amounts, dx and dy. Generally this is needed when synchronising the tab widget's view with another.

◆ scrolledBy

void scrolledBy ( int  dx,
int  dy 
)
signal

◆ selectAll

void selectAll ( )
slot

◆ setConnectionArrowLocation

void setConnectionArrowLocation ( int  loc)
slot
Parameters
locThe location (as a percentage) of the connection arrow along a connection's length.

◆ setController

void setController ( CSIRO::Presentation::WorkspaceController controller)
slot
Parameters
controllerThe workspace controller that this widget should use. If it is a null pointer, the function call has no effect.

Normally, this function is only ever called once or not at all. The only time it is generally needed is if a WorkspaceTabWidget has been created in Qt Designer and it needs to share a workspace controller with another widget. That association has to be done by creating a controller outside of the widget and calling this function with that controller. The other widget would also use the same controller too.

See also
Widgets::StandAloneWidget::controllerChange()

◆ setCurrentIndex

void setCurrentIndex ( int  index)
slot

◆ setGraphicsEffectFactory

void setGraphicsEffectFactory ( const WorkspaceGraphicsEffectFactory graphicsEffectFactory)
slot
Parameters
graphicsEffectFactoryThe effect factory to use when creating graphics effects.

◆ setGridSpacing

void setGridSpacing ( int  spacing)
slot
Parameters
spacingThe new grid spacing. Note that whether or not the grid is enabled is controlled by a separate property.
See also
getGridSpacing(), isUsingGrid(), setUsingGrid()

◆ setReadOnly()

void setReadOnly ( bool  b)

◆ setSceneRect

void setSceneRect ( const QRectF &  rect)
slot
Parameters
rectThe desired bounds of the SceneRect (i.e. the viewable area of the scene).

Sets the viewable area of the scene attached to the currennt view to the specified rect. Generally this is needed when synchronising the tab widget's view with another.

◆ setSuppressingConnectionWarnings()

void setSuppressingConnectionWarnings ( bool  b) const
Parameters
bSet to true if connection warnings are inappropriate

◆ setUsingExtendedSelection()

void setUsingExtendedSelection ( bool  b) const
Parameters
bSet to true if the widget is being used by a tool rather than the workspace editor

◆ setUsingGrid

void setUsingGrid ( bool  enabled)
slot
Parameters
enabledIf true, then snap to grid will be enabled. The spacing of the grid is controlled by a separate property.
See also
setUsingGrid(), setGridSpacing(), getGridSpacing()

◆ setUsingPlaceholderGraphics()

void setUsingPlaceholderGraphics ( bool  b)

◆ setViewportTransform

void setViewportTransform ( const QMatrix &  transform)
slot
Parameters
transformThe desired viewport transform.

Sets the viewport transform to the specified value. Generally this is needed when synchronising the tab widget's view with another.

◆ setViewportTransformAnchor()

void setViewportTransformAnchor ( QGraphicsView::ViewportAnchor  anchor)

◆ showEvent()

void showEvent ( QShowEvent *  event)
overrideprotected

When the widget is shown, the progress bars will need to be updated, so this function enables those updates. This will result in a progressBarsCanUpdate() signal being emitted.

See also
hideEvent()

◆ showHelp

void showHelp ( )
slot

◆ showIOBase

void showIOBase ( DataExecution::IOBase iobase,
bool  centerOnOp = true 
)
slot

◆ showOperation [1/2]

void showOperation ( const QString &  operationIdPath,
bool  centerOnOp = true 
)
slot

◆ showOperation [2/2]

void showOperation ( CSIRO::DataExecution::Operation operation,
bool  centerOnOp = true 
)
slot

◆ showTab

void showTab ( CSIRO::DataExecution::Workspace workspace)
slot

◆ statusBarText

void statusBarText ( const QString &  msg)
signal

◆ toggleOpProgressBars

void toggleOpProgressBars ( bool  isChecked)
slot
Parameters
isCheckedWhether or not progress bars should be shown / hidden.

◆ usingGrid

void usingGrid ( bool  enabled)
signal

◆ viewportTransformChanged

void viewportTransformChanged ( const QMatrix &  transform)
signal

◆ workspaceInputOutputVariableVisibilityPolicyChanged

void workspaceInputOutputVariableVisibilityPolicyChanged ( )
signal

◆ zoomFitAll

void zoomFitAll ( )
slot

◆ zoomFitSelection

void zoomFitSelection ( )
slot

◆ zoomIn

void zoomIn ( )
slot

◆ zoomOut

void zoomOut ( )
slot

◆ zoomReset

void zoomReset ( )
slot

Property Documentation

◆ count

int count
read

◆ currentIndex

int currentIndex
readwrite

◆ gridSpacing

int gridSpacing
readwrite

◆ progressBarsUpdatable

bool progressBarsUpdatable
read

◆ useGrid

bool useGrid
readwrite