• 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
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • GUI - CDP Widgets
  • CDPBaseRadioButton

CDPBaseRadioButton Class

The Radio Button is a button type that is used when having several options and only allowing one to be selected. More...

Header: #include <CDPBaseWidgets/CDPBaseRadioButton.h>
  • List of all members, including inherited members

Properties

  • autoExclusive : bool
  • buttonDiameter : int
  • cdpCheckedRouting : QString
  • cdpEnabledRouting : QString
  • cdpMessageCommand : QString
  • cdpMessageParameter : QString
  • cdpMessageProperty : QString
  • cdpMessageRouting : QString
  • cdpStyleRouting : QString
  • checkableByClick : bool
  • checkedValue : int
  • disabledStateOpacity : double
  • font : QFont
  • margins : int
  • pushRoutables : const QStringList
  • spacing : int
  • style : int
  • svgFile : QString
  • text : QString

Public Functions

CDPBaseRadioButton(QWidget *parent = 0)
bool autoExclusive() const
int buttonDiameter() const
QString cdpChecked()
QString cdpEnabled()
QString cdpMessageCommand() const
QString cdpMessageParameter() const
QString cdpMessageProperty()
QString cdpMessageRouting() const
QString cdpStyle()
bool checkableByClick() const
int checkedValue()
virtual double disabledStateOpacity() const
const QFont &font() const
QString imageChecked() const
int margins() const
QSize minimumSizeHint() const
virtual const QStringList &pushRoutables() const
void setAutoExclusive(bool autoExclusive)
void setButtonDiameter(int diameter)
void setCdpChecked(const QString &routing)
void setCdpEnabled(const QString &routing)
void setCdpMessageCommand(const QString &command)
void setCdpMessageParameter(const QString &parameter)
void setCdpMessageProperty(const QString &name)
void setCdpMessageRouting(const QString &routing)
void setCdpStyle(const QString &routing)
void setCheckableByClick(bool checkable)
void setCheckedValue(int value)
virtual void setDisabledStateOpacity(double opacity)
void setFont(const QFont &font)
void setImageChecked(QString pixPath)
void setMargins(int margins)
void setQtCDPInterface(IQtCDP *pIQtCDP)
void setShowText(bool show)
void setSpacing(int spacing)
void setStyle(int style)
void setSvgDebugEnabled(bool enabled)
void setSvgFile(const QString &svg)
void setSvgFileOrImageBasedOnFormat(QString svg)
void setText(const QString &text)
bool showText() const
int spacing() const
int style()
QString svgFile() const
QString svgFileOrImageBasedOnFormat() const
QString text() const

Public Slots

void setChecked(bool checked)

Signals

void checked(int)
void pushRoutablesChanged(const QStringList &pushers)
void released()
void toggled(bool)

Protected Functions

void changeEvent(QEvent *e) override

Detailed Description

The Radio Button is a button type that is used when having several options and only allowing one to be selected.

The radio button can be used to show and control the state of external communication objects just like the ordinary CDPBaseButton. Typical usage is to set routing on cdpCheckedRouting and use checkedValue to specify which remote value that should make the radio button checked. When checkableByClick is set true, toggling the button by click will also toggle the remote object value. To avoid this, set checkableByClick to false and use the message properties to request checked state.

The message properties are similar to the message properties of CDPBaseButtonMsg. Add routing and enter the text command to send. Use the property and parameter properties when wanting to send a set property message instead of a text command. This can be used to change the value of any routed communication object.

The widget is styled by SVG similar to the ordinary CDPBaseButton.

Property Documentation

autoExclusive : bool

This property holds whether the button should uncheck all other radio buttons in the group (siblings) when it gets checked.

Access functions:

bool autoExclusive() const
void setAutoExclusive(bool autoExclusive)

buttonDiameter : int

This property holds the diameter of the button image in pixels.

Access functions:

int buttonDiameter() const
void setButtonDiameter(int diameter)

cdpCheckedRouting : QString

This property holds the routing to a CDP object that are to control the checked state of the widget.

Access functions:

QString cdpChecked()
void setCdpChecked(const QString &routing)

cdpEnabledRouting : QString

This property holds the routing of the CDP object that are to enable/disable the button.

Access functions:

QString cdpEnabled()
void setCdpEnabled(const QString &routing)

cdpMessageCommand : QString

This property holds the text command to send to destination.

Access functions:

QString cdpMessageCommand() const
void setCdpMessageCommand(const QString &command)

cdpMessageParameter : QString

This property holds the text/value to send along with the message.

Access functions:

QString cdpMessageParameter() const
void setCdpMessageParameter(const QString &parameter)

cdpMessageProperty : QString

This property holds the name of the property to update in routed cdp object. The property will get updated with the text added in cdpMessageParameter.

Access functions:

QString cdpMessageProperty()
void setCdpMessageProperty(const QString &name)

cdpMessageRouting : QString

This property holds the full name of the CDP object that we want to message.

Access functions:

QString cdpMessageRouting() const
void setCdpMessageRouting(const 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(const QString &routing)

checkableByClick : bool

This property holds whether to make it possible to check the button by click or (send request and) wait for routed object to set it checked.

Access functions:

bool checkableByClick() const
void setCheckableByClick(bool checkable)

checkedValue : int

This property holds the value that will get emitted in checked(int). It is also the value that will set the button checked when receiving values from object routed in cdpCheckedRouting. The property is similar to CDPBaseButton::valueToEmit.

Access functions:

int checkedValue()
void setCheckedValue(int value)

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 label font.

Access functions:

const QFont &font() const
void setFont(const QFont &font)

margins : int

This property holds the margins around the button and label.

Access functions:

int margins() const
void setMargins(int margins)

pushRoutables : const QStringList

Access functions:

virtual const QStringList &pushRoutables() const

Notifier signal:

void pushRoutablesChanged(const QStringList &pushers)

spacing : int

This property holds the spacing between the button and label.

Access functions:

int spacing() const
void setSpacing(int spacing)

style : int

This property holds the widget style to use in the svg file (will only have effect if the svg file provides styles).

Access functions:

int style()
void setStyle(int style)

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 that resources can be overridden by files on disk with identical names.

Access functions:

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

text : QString

This property holds the text to show on the widget.

Access functions:

QString text() const
void setText(const QString &text)

Member Function Documentation

CDPBaseRadioButton::CDPBaseRadioButton(QWidget *parent = 0)

Default constructs an instance of CDPBaseRadioButton.

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

[signal] void CDPBaseRadioButton::checked(int)

See also setChecked().

QString CDPBaseRadioButton::imageChecked() const

See also setImageChecked().

QSize CDPBaseRadioButton::minimumSizeHint() const

[signal] void CDPBaseRadioButton::released()

[slot] void CDPBaseRadioButton::setChecked(bool checked)

See also checked().

void CDPBaseRadioButton::setImageChecked(QString pixPath)

See also imageChecked().

void CDPBaseRadioButton::setQtCDPInterface(IQtCDP *pIQtCDP)

void CDPBaseRadioButton::setShowText(bool show)

See also showText().

void CDPBaseRadioButton::setSvgDebugEnabled(bool enabled)

void CDPBaseRadioButton::setSvgFileOrImageBasedOnFormat(QString svg)

See also svgFileOrImageBasedOnFormat().

bool CDPBaseRadioButton::showText() const

See also setShowText().

QString CDPBaseRadioButton::svgFileOrImageBasedOnFormat() const

See also setSvgFileOrImageBasedOnFormat().

[signal] void CDPBaseRadioButton::toggled(bool)

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 2024 CDP Technologies. Privacy and cookie policy.

Return to top