• 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
  • CDPBaseCheckBox

CDPBaseCheckBox Class

The Check Box is a check box widget with options for styling and communication. More...

Header: #include <CDPBaseCheckBox>
Inherits: CDPBaseWidget and CDPBaseCom
  • List of all members, including inherited members

Properties

  • cdpOfflineValue : const double
  • cdpOfflineValueEnabled : const bool
  • cdpRouting : QString
  • cdpStyleRouting : QString
  • checked : bool
  • disabledStateOpacity : double
  • font : QFont
  • iconSizeMax : QSize
  • svgFile : QString
  • text : QString
  • 6 properties inherited from CDPBaseWidget

Public Functions

CDPBaseCheckBox(QWidget *parent = 0)
virtual ~CDPBaseCheckBox()
QString cdpStyle()
virtual bool checked()
virtual double disabledStateOpacity() const
virtual QSize iconSizeMax()
virtual QString routing()
void setCdpStyle(QString routing)
virtual void setDisabledStateOpacity(double opacity)
virtual void setIconSizeMax(QSize size)
virtual void setRouting(QString routing)
virtual void setSvgFile(const QString &svg)
virtual void setText(QString text)
virtual void setTextFont(QFont font)
virtual QString svgFile()
virtual QString text()
virtual QFont textFont()
  • 8 public functions inherited from CDPBaseWidget
  • 17 public functions inherited from CDPBaseCom
  • 4 public functions inherited from CDPBaseControlVisible

Public Slots

virtual void setChecked(bool checked)
virtual void setValue(double value)
void setValueFromSignal()
  • 10 public slots inherited from CDPBaseWidget

Signals

void stateChanged(int state)
void toggled(bool checked)
  • 1 signal inherited from CDPBaseWidget

Protected Functions

void changeEvent(QEvent *e) override
void mouseReleaseEvent(QMouseEvent *event) override
  • 4 protected functions inherited from CDPBaseCom
  • 1 protected function inherited from CDPBaseControlVisible

Additional Inherited Members

  • 2 static public members inherited from CDPBaseCom

Detailed Description

The Check Box is a check box widget with options for styling and communication.

The widget sends 1 for checked or 0 for unchecked.

Styling by SVG

Use the svgFile property to style the widget using a svg file. Styling by svg enables switching between different themes in runtime (as long as the files are placed at identical locations within theme directories).

The CDPBaseCheckBox uses the same svg structure as CDPBasePictureSequence. The first picture represents the unchecked state while the second picture represents the checked state. See the styling guide for CDPBasePictureSequence for svg structure names.

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.

cdpRouting : QString

This property holds the full name of the CDP object that the widget is to connect and control.

The routing is bi-directional. This means that if two check boxes or other widgets are routed to control the same remote object, they will all receive and show new values when the remote value is changed.

Access functions:

virtual QString routing()
virtual void setRouting(QString routing)

cdpStyleRouting : QString

This property holds the routing of the CDP object that are to change the widget svg style.

Access functions:

QString cdpStyle()
void setCdpStyle(QString routing)

checked : bool

This property holds the checked state of the widget.

Access functions:

virtual bool checked()
virtual void setChecked(bool checked)

disabledStateOpacity : double

This property holds the level of opacity for the widget in the disabled state.

The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).

Setting this property configures a fixed opacity that can be different than the global opacity used in other widgets.

Access functions:

virtual double disabledStateOpacity() const
virtual void setDisabledStateOpacity(double opacity)

font : QFont

This property holds the text font.

Access functions:

virtual QFont textFont()
virtual void setTextFont(QFont font)

iconSizeMax : QSize

This property holds the max size of the check box icon.

Access functions:

virtual QSize iconSizeMax()
virtual void setIconSizeMax(QSize size)

svgFile : QString

This property holds the path to the svg file that styles the widget.

The path can be either to a resource or a file on disk.

Note: resources can be overridden by files on disk with identical names.

Access functions:

virtual QString svgFile()
virtual void setSvgFile(const QString &svg)

text : QString

This property holds the text to show beside the check box.

Access functions:

virtual QString text()
virtual void setText(QString text)

Member Function Documentation

CDPBaseCheckBox::CDPBaseCheckBox(QWidget *parent = 0)

Default constructs an instance of CDPBaseCheckBox.

[virtual] CDPBaseCheckBox::~CDPBaseCheckBox()

Destroys the instance of CDPBaseCheckBox. The destructor is virtual.

[protected] void CDPBaseCheckBox::changeEvent(QEvent *e)

[protected] void CDPBaseCheckBox::mouseReleaseEvent(QMouseEvent *event)

[virtual slot] void CDPBaseCheckBox::setValue(double value)

[slot] void CDPBaseCheckBox::setValueFromSignal()

[signal] void CDPBaseCheckBox::stateChanged(int state)

[signal] void CDPBaseCheckBox::toggled(bool checked)

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