Top-level only abstract tree-based dialog box for displaying inputs and outputs with DisplayWidgets.
More...
#include <Workspace/Presentation/displaywidgettree.h>
|
| DisplayWidgetTree (int displayWidgetCol, int selectWidgetCol, DataExecution::Workspace &workspace, bool readOnly=false, QWidget *parent=nullptr) |
|
bool | isModified () |
|
void | onLoadRows () |
|
bool | registerItem (QTreeWidgetItem *item, DataExecution::IOBase *ioBase, PortType portType, bool readOnly=false) |
|
void | setMaxRowHeight (int maxRowHeight) |
|
Public Member Functions inherited from SortOnDemandTreeWidget |
| SortOnDemandTreeWidget (QWidget *parent=nullptr) |
|
int | rowHeight (int row) const |
| Returns the current height of the nominated row.
|
|
void | setDragPixmap (const QPixmap &pixmap) |
| Sets pixmap as the pixmap used to represent the data in a drag and drop operation.
|
|
void | setNoEditColumnList (QList< int > noEditColumnList) |
| A list of columns that should be read-only, others will be editable by default.
|
|
void | setSortableColumnList (QList< int > sortableColumnList) |
| a list of columns that should be sorted alphabetically when the user clicks on the column header
|
|
void | setSortingOnDemandEnabled (bool value) |
|
| BasicTextLogger () |
|
virtual | ~BasicTextLogger () |
|
void | logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const |
|
void | logLine (const QString &msg) const |
|
void | logText (const Application::LogManager::MessageCategory &category, const QString &msg) const |
|
void | logText (const QString &msg) const |
|
◆ PortType
Enumerator |
---|
InputPort | Input*.
|
OutputPort | Output*.
|
InputElementPort | Member of an input array.
|
◆ Role
Enumerator |
---|
PortTypeRole | |
ReadOnlyRole |
- Input (other than array element) or Output
|
OperationIdRole |
- Whether the user can change the widget value(s) or not
|
NameRole |
- id of the operation the port is attached to
|
IndexRole |
- id of the operation the port is attached to
|
◆ DisplayWidgetTree()
Creates a dialog box populated by a top-level-only tree widgets with DisplayWidgets for the values of supplied inputs or outputs
The user is responsible for populating the tree header and rows. Each row should represent one IOBase item. Create a column for the DisplayWidgets. If you also want to display a QComboBox so that the user can choose from a selection of appropriate DisplayWidgets you should create a column for that too. If you just want to use the Preferred Display Widget for the IOBase, then set the SelectWidgetCol to -1.
- Parameters
-
displayWidgetCol | index of the column where you want the display widget |
selectWidgetCol | index of the column where you want the selection widget (-1 for none) |
workspace | Root Workspace |
readOnly | Set this to true if you want all the DisplayWidgets in the tree to be read-only |
parent | parent widget |
◆ getIOBase()
IOBase * getIOBase |
( |
QTreeWidgetItem * |
item | ) |
|
|
protected |
◆ isModified()
◆ onItemMoved
void onItemMoved |
( |
int |
from, |
|
|
int |
to |
|
) |
| |
|
protectedslot |
Notification that a row was dragged from one row to another
If multiple selections are allowed, this will return just the first selection member
- Parameters
-
from | row the item was moved from |
to | row the item was moved to |
◆ onItemsMoved
void onItemsMoved |
( |
QList< int > |
from, |
|
|
QList< int > |
to |
|
) |
| |
|
protectedslot |
Notification that some rows were dragged from one row to another
- Parameters
-
from | rows the items were moved from |
to | rows the items were moved to |
◆ onLoadRows()
◆ registerItem()
Tells the system to associate this QTreeWidgetItem with the supplied IOBase port
Call this once for each ioBase you want handled (one ioBase should be registered for each tree widget item) The system requires the data inside the DisplayWidget column reserved for internal use
- Parameters
-
item | The top-level tree item you want to display a DisplayWidget on |
ioBaseData | The Input or Output whose data it represents |
portType | The port type that ioBaseData belongs to |
readOnly | Set this to true if you want this item in particular to be read-only |
- Returns
- false if the item is not a current top-level item of the treewidget, or if the DisplayWidget column supplied is not a current column of the treewidget
◆ setDisplaySelectionWidget()
void setDisplaySelectionWidget |
( |
QTreeWidgetItem * |
item | ) |
|
|
protected |
Creates and inserts a QComboBox containing a choice of suitable Display Widgets
The QComboBox is created and inserted into the columns identified by selectWidgetCol_ A widget of the chosen type is then created and inserted into the column identified by displayWidgetCol_
◆ setDisplayWidget() [1/2]
void setDisplayWidget |
( |
QString |
widgetName, |
|
|
QTreeWidgetItem * |
item |
|
) |
| |
|
protected |
Handles creation of the display widget to be put into the QTreeWidget
- Parameters
-
widgetName | Name of the widget to be used rather than the current PreferredWidget (which it will overwrite). |
item | The item where the display widget will be embedded into. |
◆ setDisplayWidget() [2/2]
void setDisplayWidget |
( |
QTreeWidgetItem * |
item | ) |
|
|
protected |
Handles creation of the display widget to be put into the QTreeWidget. Uses the current Input or Output's PreferredWidget
- Parameters
-
item | Tree widget item which will have a new display widget embedded into. |
◆ setMaxRowHeight()
void setMaxRowHeight |
( |
int |
maxRowHeight | ) |
|
Set the maximum height allowed for a DisplayWidget inside a row before it is replaced by a wrapper button
◆ setModified