CDPBaseStackedWidget Class
The Stacked Widget is a container widget with pages similar to a tab widget. More...
Header: | #include <CDPBaseWidgets/CDPBaseStackedWidget.h> |
Inherits: | CDPBaseCom and |
Properties
|
|
Public Functions
CDPBaseStackedWidget(QWidget *parent = 0) | |
QString | cdpRouting() |
bool | resetIndexOnVisible() const |
void | setCdpRouting(const QString &routing) |
void | setResetIndexOnVisible(bool enabled) |
bool | slideShow() const |
double | slideShowIntervalSec() const |
- 17 public functions inherited from CDPBaseCom
Public Slots
virtual void | nextPage() |
virtual void | previousPage() |
virtual void | resetIndex() |
void | setSlideShow(bool enabled) |
void | setSlideShowIntervalSec(double seconds) |
virtual void | setValue(double value) |
Signals
void | startingSlideShow() |
Protected Functions
void | showEvent(QShowEvent *event) override |
- 4 protected functions inherited from CDPBaseCom
Additional Inherited Members
- 2 static public members inherited from CDPBaseCom
Detailed Description
The Stacked Widget is a container widget with pages similar to a tab widget.
The different pages in the Stacked Widget are populated similarly to the Tab Widget, but as there are no buttons to select the different pages in runtime, we need to control the selected page using routing to a control system or using widget signal and slot connections.
In the CDP Studio Design mode, there are arrows in the top right corner to switch pages while designing the GUI. Inserting new pages into the Stacked Widget is done by right-clicking and selecting “Insert Page”. Deleting a page is done by right-clicking and selecting "Page x of x > Delete".
A typical use case for the Stacked Widget is to create a GUI menu system as discussed in How to Use Buttons in a Menu. Compared to the Tab Widget, we can customize and place buttons anywhere in the GUI for selecting what page to show.
Switching pages from a control system can be used to hide or show different widgets and texts based on external events like alarms and component states. We can also do simple stuff like placing lamps in different colors on different pages to select them using specific remote object values.
The Stacked Widget supports showing a slideshow. Using this feature will make it switch pages at a configurable interval as demonstrated on page two of the SCADA example.
Property Documentation
cdpOfflineValue : const double
This property holds the value to show when communication is offline and cdpOfflineValueEnabled is set to true.
The property has no effect when cdpOfflineValueEnabled is set to false
.
See also cdpOfflineValueEnabled.
cdpOfflineValueEnabled : const bool
This property holds whether or not to show cdpOfflineValue when communication is offline.
Setting the property to false
will make the widget keep/show the last value when communication is down.
See also cdpOfflineValue.
cdpPageRouting : QString
This property holds the routing to the cdp object we want to use for switching between pages.
Access functions:
QString | cdpRouting() |
void | setCdpRouting(const QString &routing) |
resetIndexOnVisible : bool
This property holds whether or not to set current index to 0 every time the widget becomes visible.
Access functions:
bool | resetIndexOnVisible() const |
void | setResetIndexOnVisible(bool enabled) |
slideShow : bool
This property holds whether or not to start a slideshow showing each page at the duration specified in slideShowIntervalSec.
The slideshow can be paused by setting slideShowIntervalSec to zero and resumed by giving it a value.
To reset the page index to 0 every time the slideshow is resumed or started, make a signal and slot connection from startingSlideShow() to resetIndex(). If the slideshow is never paused and resumed, but we want to ensure that it always starts showing the first page both on startup and every time the page becomes visible, use the property named resetIndexOnVisible instead.
Access functions:
bool | slideShow() const |
void | setSlideShow(bool enabled) |
See also slideShowIntervalSec.
slideShowIntervalSec : double
This property holds the duration of seconds to show each page when running a slideshow.
Access functions:
double | slideShowIntervalSec() const |
void | setSlideShowIntervalSec(double seconds) |
See also slideShow.
Member Function Documentation
CDPBaseStackedWidget::CDPBaseStackedWidget(QWidget *parent = 0)
Default constructs an instance of CDPBaseStackedWidget.
[virtual slot]
void CDPBaseStackedWidget::nextPage()
[virtual slot]
void CDPBaseStackedWidget::previousPage()
[virtual slot]
void CDPBaseStackedWidget::resetIndex()
[virtual slot]
void CDPBaseStackedWidget::setValue(double value)
[protected]
void CDPBaseStackedWidget::showEvent(QShowEvent *event)
[signal]
void CDPBaseStackedWidget::startingSlideShow()
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.