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

#include <Workspace/Presentation/workspacemodelfilter.h>

Inherits QSortFilterProxyModel.

Public Types

enum  FilterFlag {
  ShowInputs = 0x0001 , ShowOutputs = 0x0002 , ShowDependencies = 0x0004 , ShowOperations = 0x0008 ,
  ShowNestedWorkflows = 0x0010 , ShowGlobalNames = 0x0020 , ShowUuids = 0x0040 , ShowOpTypes = 0x0080 ,
  ShowExternalFilePaths = 0x0100 , AutoExpandOnFilterChange = 0x0200 , SortInputsOutputsAlphabetically = 0x0400
}
 
enum  FilterTarget {
  FilterAnyMatch , FilterLabels , FilterGlobalNames , FilterInputsOutputs ,
  FilterUuid , FilterOpType
}
 

Public Slots

void setAutoExpand (bool b)
 
void setFilterAnyMatch ()
 
void setFilterGlobalNames ()
 
void setFilterInputsOutputs ()
 
void setFilterOperationNames ()
 
void setFilterOpType ()
 
void setFilterUuid ()
 
void setShowDependencies (bool b)
 
void setShowFilePaths (bool b)
 
void setShowGlobalNames (bool b)
 
void setShowInputs (bool b)
 
void setShowNestedWorkflows (bool b)
 
void setShowOperations (bool b)
 
void setShowOpTypes (bool b)
 
void setShowOutputs (bool b)
 
void setShowUuids (bool b)
 
void setSortIOAlphabetically (bool b)
 

Signals

void modelUpdatedByUser ()
 

Public Member Functions

 WorkspaceModelFilter (QAbstractItemModel &sourceModel)
 
bool getFilterAnyMatch () const
 
bool getFilterGlobalNames () const
 
bool getFilterInputsOutputs () const
 
bool getFilterOperationNames () const
 
bool getFilterOpType () const
 
FilterTarget getFilterTarget () const
 
bool getFilterUuid () const
 
QString getTargetAsString () const
 
void resetFilterFlags ()
 
void setFilterFlag (FilterFlag flag, bool on=true, bool updateSettings=true)
 
void setFilterFlags (FilterFlags flags)
 Resets the filter flags.
 
void setFilterTarget (const FilterTarget &target)
 Resets the filter target.
 
bool testFilterFlag (FilterFlag flag) const
 

Static Public Member Functions

static void clearPresets ()
 
static QStringList getWorkflowTreePresetNames ()
 
static bool loadFilterTarget (const QString &presetName, FilterTarget &target)
 
static bool loadFilterValues (const QString &presetName, FilterFlags &flags)
 
static void resetFilterFlags (FilterFlags &flags)
 
static bool saveFilterTarget (const QString &presetName, const FilterTarget &target)
 
static bool saveFilterValues (const QString &presetName, const FilterFlags &flags)
 
static QString toString (FilterTarget target)
 

Public Attributes

FilterFlags filterFlags_
 

Protected Member Functions

bool filterAcceptsColumn (int sourceColumn, const QModelIndex &sourceParent) const override
 
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 
FilterTarget filterToEnum (const QString &filter)
 
QString filterToString (FilterTarget filter) const
 
FilterTarget getFilterTargetSetting ()
 
void initFilterFlagFromSetting (FilterFlag flag)
 
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 
void updateFilterTargetSetting (FilterTarget target)
 
void updateSetting (FilterFlag flag, bool on)
 

Static Protected Member Functions

static const QMap< FilterTarget, QString > & getFilterMap ()
 

Protected Attributes

FilterTarget filterTarget_
 

Member Enumeration Documentation

◆ FilterFlag

enum FilterFlag
Enumerator
ShowInputs 
ShowOutputs 
ShowDependencies 
ShowOperations 
ShowNestedWorkflows 
ShowGlobalNames 
ShowUuids 
ShowOpTypes 
ShowExternalFilePaths 
AutoExpandOnFilterChange 
SortInputsOutputsAlphabetically 

◆ FilterTarget

Enumerator
FilterAnyMatch 
FilterLabels 
FilterGlobalNames 
FilterInputsOutputs 
FilterUuid 
FilterOpType 

Constructor & Destructor Documentation

◆ WorkspaceModelFilter()

WorkspaceModelFilter ( QAbstractItemModel &  sourceModel)

Member Function Documentation

◆ clearPresets()

void clearPresets ( )
static

◆ filterAcceptsColumn()

bool filterAcceptsColumn ( int  sourceColumn,
const QModelIndex &  sourceParent 
) const
overrideprotected

◆ filterAcceptsRow()

bool filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
overrideprotected

◆ filterToEnum()

WorkspaceModelFilter::FilterTarget filterToEnum ( const QString &  filter)
protected

◆ filterToString()

QString filterToString ( FilterTarget  filter) const
protected

◆ getFilterAnyMatch()

bool getFilterAnyMatch ( ) const
inline

◆ getFilterGlobalNames()

bool getFilterGlobalNames ( ) const
inline

◆ getFilterInputsOutputs()

bool getFilterInputsOutputs ( ) const
inline

◆ getFilterMap()

const QMap< WorkspaceModelFilter::FilterTarget, QString > & getFilterMap ( )
staticprotected

◆ getFilterOperationNames()

bool getFilterOperationNames ( ) const
inline

◆ getFilterOpType()

bool getFilterOpType ( ) const
inline

◆ getFilterTarget()

FilterTarget getFilterTarget ( ) const
inline

◆ getFilterTargetSetting()

WorkspaceModelFilter::FilterTarget getFilterTargetSetting ( )
protected

◆ getFilterUuid()

bool getFilterUuid ( ) const
inline

◆ getTargetAsString()

QString getTargetAsString ( ) const

◆ getWorkflowTreePresetNames()

QStringList getWorkflowTreePresetNames ( )
static

◆ initFilterFlagFromSetting()

void initFilterFlagFromSetting ( FilterFlag  flag)
protected

◆ lessThan()

bool lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
overrideprotected

◆ loadFilterTarget()

bool loadFilterTarget ( const QString &  presetName,
FilterTarget target 
)
static

◆ loadFilterValues()

bool loadFilterValues ( const QString &  presetName,
FilterFlags &  flags 
)
static

◆ modelUpdatedByUser

void modelUpdatedByUser ( )
signal

◆ resetFilterFlags() [1/2]

void resetFilterFlags ( )

◆ resetFilterFlags() [2/2]

void resetFilterFlags ( FilterFlags &  flags)
static

◆ saveFilterTarget()

bool saveFilterTarget ( const QString &  presetName,
const FilterTarget target 
)
static

◆ saveFilterValues()

bool saveFilterValues ( const QString &  presetName,
const FilterFlags &  flags 
)
static

◆ setAutoExpand

void setAutoExpand ( bool  b)
slot

If true, the tree is will be expanded after every change to the text in the line edit widget

◆ setFilterAnyMatch

void setFilterAnyMatch ( )
slot

Display rows which would match any of the other filter types: global names, operation type, label, IO or uuid

◆ setFilterFlag()

void setFilterFlag ( WorkspaceModelFilter::FilterFlag  flag,
bool  on = true,
bool  updateSettings = true 
)

◆ setFilterFlags()

void setFilterFlags ( FilterFlags  flags)

This does not update the application WorkspaceTreeWidget settings

◆ setFilterGlobalNames

void setFilterGlobalNames ( )
slot

Display rows where the item has a global name that matches the text

◆ setFilterInputsOutputs

void setFilterInputsOutputs ( )
slot

Display input and output rows where the input or output name matches the text

◆ setFilterOperationNames

void setFilterOperationNames ( )
slot

Display operation rows where the operation label matches the text

◆ setFilterOpType

void setFilterOpType ( )
slot

Display operation rows where the operation type matches the text

◆ setFilterTarget()

void setFilterTarget ( const FilterTarget target)

This does not update the application WorkspaceTreeWidget settings

◆ setFilterUuid

void setFilterUuid ( )
slot

Display operation rows where the operation uuid matches the text

◆ setShowDependencies

void setShowDependencies ( bool  b)
slot

Show or hide dependencies (inputs or outputs)

◆ setShowFilePaths

void setShowFilePaths ( bool  b)
slot

Show or hide the External file path column

◆ setShowGlobalNames

void setShowGlobalNames ( bool  b)
slot

Show or hide the Global name column

◆ setShowInputs

void setShowInputs ( bool  b)
slot

Show or hide inputs

◆ setShowNestedWorkflows

void setShowNestedWorkflows ( bool  b)
slot

Show or hide the nested workflows (currently always true)

◆ setShowOperations

void setShowOperations ( bool  b)
slot

Show or hide operations (other than nested workflows which are always shown)

◆ setShowOpTypes

void setShowOpTypes ( bool  b)
slot

Show or hide the Operation type column

◆ setShowOutputs

void setShowOutputs ( bool  b)
slot

Show or hide outputs

◆ setShowUuids

void setShowUuids ( bool  b)
slot

Show or hide the Uuid column

◆ setSortIOAlphabetically

void setSortIOAlphabetically ( bool  b)
slot

It true, the inputs and outputs for a given operation will be sorted alphabetically. If false, they are sorted according to their displayed order Inputs and outputs are always treated separately

◆ testFilterFlag()

bool testFilterFlag ( WorkspaceModelFilter::FilterFlag  flag) const

◆ toString()

QString toString ( FilterTarget  target)
static

◆ updateFilterTargetSetting()

void updateFilterTargetSetting ( FilterTarget  target)
protected

◆ updateSetting()

void updateSetting ( FilterFlag  flag,
bool  on 
)
protected

Member Data Documentation

◆ filterFlags_

FilterFlags filterFlags_

◆ filterTarget_

FilterTarget filterTarget_
protected