NodeContainer Class
The Node Container is used for node-based ui file tiling. More...
Header: | #include <CDPBaseWidgets/NodeContainer.h> |
Inherits: | RoutingContainerBase and |
Properties
|
|
Public Functions
NodeContainer(QWidget *parent = nullptr) | |
virtual | ~NodeContainer() |
QString | childContainerName() const |
QStringList | forceNodes() const |
QStringList | modelFilter() const |
virtual void | setChildContainerName(const QString &filename) |
virtual void | setForceNodes(const QStringList &nodes) |
virtual void | setModelFilter(const QStringList &modelTypes) |
virtual void | setUiFileName(const QString &filename) |
QString | uiFileName() const |
- 3 public functions inherited from RoutingContainerBase
Public Slots
void | clearContainer(QWidget *container) |
void | reloadNodes() |
virtual void | setCdpTargetRouting(const QString &routing) override |
Protected Functions
void | createModel() |
QStringList | nodeList() |
QString | routingPrefix() |
Additional Inherited Members
- 3 static public members inherited from RoutingContainerBase
Detailed Description
The Node Container is used for node-based ui file tiling.
The target routing is configured in the cdpTargetRouting property and nodes are filtered based on the model types specified in the modelFilter property. The resulting nodes will load using the UI/form file specified in the uiFileName property. By default, they will be displayed as tiles in a flow-style layout. However, you can easily customize this layout by editing the childContainerName property and adding a container that aligns better with your preferences and needs.
Configuring the childContainerName property enables adding one of the following containers:
- The Flow Widget is already the default, but adding it to the Node Container allows editing all Flow Widget properties like margins and spacings.
- The Row is used when you want to show the tiles horizontally or vertically based on the window size.
- The Tab Widget shows the tiles on separate tab pages displaying the node names on the tab buttons.
- The Picture can be used to place nodes on pixel positions rather than container layouts. A typical use case is to make the picture show a map and load nodes on top of it at different locations. The UI/form file showing the nodes must be created using Picture or Picture Sequence as the form template. They both include properties for controlling the position and can be used as containers when needing to show more than just a picture.
- Other containers, like Group Box, Frame, and plain Widget can be added, but must contain a vertical or horizontal layout as explained in the childContainerName property details.
The loaded ui file can be based on any widget, but a RoutingContainer is often used to enable a temporary target routing while editing its relative routings. Target routing set on a top-level RoutingContainer will get replaced when loaded by the Node Container.
There is also a property, forceNodes, for hardcoding the nodes to load as ui tiles. This is useful when wanting a fixed subset of nodes from the cdpTargetRouting, or for testing the design within the CDP Studio Design mode.
The cdpTargetRouting can also be executed as a slot in runtime to load nodes from a different target.
See Creating a Dynamic GUI for Showing Dialogs for an example demonstrating how the Node Container can be used to load dialog buttons for controlling Sine components.
Note: The searching of nodes was added for native GUI in CDP 4.12
Property Documentation
cdpFullTargetRouting : const QString
cdpTargetRouting : QString
This property holds the target routing to search for nodes.
Access functions:
virtual void | setCdpTargetRouting(const QString &routing) override |
childContainerName : QString
This property holds the object name of a child widget to load the nodes.
The property makes it possible to use a different container/layout than the default flow widget for showing the node-based ui file tiles. This allows any number of widgets in the container as long as we specify the one child that is to load the nodes.
Configure childContainerName with a name before starting to add widgets. This makes it possible to add any layout to the NodeContainer. The layout is set by first adding widget children, clicking the background in the NodeContainer, and selecting the layout from the toolbox above the form.
Elements like the Row, Tab, and Flow widgets can be used for loading node tiles without any additional configuration other than making sure that their objectName property matches the childContainerName property. Other widgets, like the group box, frame, and plain widget require a configured layout. A widget must contain at least one child widget to be able to set a layout. The child can be deleted when the layout has been added.
Access functions:
QString | childContainerName() const |
virtual void | setChildContainerName(const QString &filename) |
forceNodes : QStringList
This property holds a list of nodes to load as ui tiles.
This is useful when wanting a fixed subset of nodes or for testing the design within the CDP Studio Design mode.
Access functions:
QStringList | forceNodes() const |
virtual void | setForceNodes(const QStringList &nodes) |
modelFilter : QStringList
This property holds a list of model types that the container accepts and shows.
Access functions:
QStringList | modelFilter() const |
virtual void | setModelFilter(const QStringList &modelTypes) |
uiFileName : QString
This property holds the name of an ui file to load for each valid node found in the cdpTargetRouting.
Access functions:
QString | uiFileName() const |
virtual void | setUiFileName(const QString &filename) |
Member Function Documentation
NodeContainer::NodeContainer(QWidget *parent = nullptr)
Default constructs an instance of NodeContainer.
[virtual]
NodeContainer::~NodeContainer()
Destroys the instance of NodeContainer. The destructor is virtual.
[slot]
void NodeContainer::clearContainer(QWidget *container)
[protected]
void NodeContainer::createModel()
[protected]
QStringList NodeContainer::nodeList()
[slot]
void NodeContainer::reloadNodes()
[protected]
QString NodeContainer::routingPrefix()
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.