• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • GUI - CDP Widgets
  • CDPRow

CDPRow Class

The CDPRow switches layout from horizontal to vertical at a configurable width. More...

Header: #include <CDPRow>
  • List of all members, including inherited members

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

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top