CDPRow Class
The CDPRow switches layout from horizontal to vertical at a configurable width. More...
Header: | #include <CDPBaseWidgets/CDPRow.h> |
Properties
- layoutSwitchWidth : int
Public Functions
CDPRow(QWidget *parent = nullptr) | |
void | addWidget(QWidget *widget, const QString &title = "") override |
int | layoutSwitchWidth() |
void | removeWidgets() override |
void | setLayoutSwitchWidth(int verticalWidth) |
Protected Functions
bool | event(QEvent *event) override |
bool | eventFilter(QObject *object, QEvent *event) override |
void | resizeEvent(QResizeEvent *event) override |
QSize | sizeHint() const override |
Detailed Description
The CDPRow switches layout from horizontal to vertical at a configurable width.
The widget is useful when you want your GUI to support both large and small screen sizes. On a PC screen you usually want multiple containers per GUI row, but when the screen width is small, you might want it to switch to just one column and show the containers on multiple rows. This is achieved by placing the containers in a CDPRow widget and setting the layoutSwitchWidth property to the pixel width where you want to do the switch to multiple rows.
To ensure that the containers show correctly in the vertical layout, it is important that they are configured with reasonable minimumHeight. Also, as the GUI height is likely to increase when showing using a vertical layout, the page should be placed within a QScrollArea widget.
Using a QScrollArea might require tweaking widget configuration if wanting a low initial height without showing the scroll bars. Some widgets, like the vertical bar and slider, read their size hints from SVG. The height in the SVG can be pretty high. To reduce the initial height, these widgets support using the baseSize property to override the sizeHint.
Note: The row widget layout margins are often configured with low values. This can make it hard to select in the form using CDP Studio Design mode. If this is a problem, click somewhere close to its edge and use the object inspector panel to select it.
Property Documentation
layoutSwitchWidth : int
This property holds the window width that will trigger a layout orientation switch.
Access functions:
int | layoutSwitchWidth() |
void | setLayoutSwitchWidth(int verticalWidth) |
Member Function Documentation
CDPRow::CDPRow(QWidget *parent = nullptr)
Default constructs an instance of CDPRow.
void CDPRow::addWidget(QWidget *widget, const QString &title = "")
Adds widget to the layout that is currently active, ignoring the title argument.
[protected]
bool CDPRow::event(QEvent *event)
[protected]
bool CDPRow::eventFilter(QObject *object, QEvent *event)
int CDPRow::layoutSwitchWidth()
Returns the window width that will trigger a layout orientation switch.
Note: Getter function for property layoutSwitchWidth.
See also setLayoutSwitchWidth().
void CDPRow::removeWidgets()
[protected]
void CDPRow::resizeEvent(QResizeEvent *event)
void CDPRow::setLayoutSwitchWidth(int verticalWidth)
Sets the verticalWidth that will trigger a layout orientation switch.
Note: Setter function for property layoutSwitchWidth.
See also layoutSwitchWidth().
[protected]
QSize CDPRow::sizeHint() const
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.