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

CDPBaseTitle Class

Title box for showing titles with optional unit. More...

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

Properties

  • cdpStyleRouting : QString
  • titleText : QString
  • unitText : QString
  • unitTextShow : bool
  • 21 properties inherited from CDPBaseContainer
  • 6 properties inherited from CDPBaseWidget

Public Functions

CDPBaseTitle(QWidget *parent = 0)
QString cdpStyle()
void setCdpStyle(QString routing)
virtual void setShowUnitText(bool show)
virtual void setTitleText(QString text)
virtual void setUnitText(QString text)
virtual bool showUnitText()
virtual QString titleText()
virtual QString unitText()
  • 44 public functions inherited from CDPBaseContainer
  • 8 public functions inherited from CDPBaseWidget
  • 3 public functions inherited from RoutingContainerBase
  • 4 public functions inherited from CDPBaseControlVisible

Public Slots

virtual void setWidgetFont(const QString &font)
virtual void setWidgetStyle(int style)
virtual void updateSvgFont(bool skipSize = false)
  • 15 public slots inherited from CDPBaseContainer
  • 10 public slots inherited from CDPBaseWidget

Reimplemented Protected Functions

virtual void processSvgFile(QString svg) override
  • 5 protected functions inherited from CDPBaseContainer
  • 1 protected function inherited from CDPBaseControlVisible

Additional Inherited Members

  • 1 signal inherited from CDPBaseWidget
  • 3 static public members inherited from RoutingContainerBase
  • 5 protected functions inherited from CDPBaseContainer
  • 1 protected function inherited from CDPBaseControlVisible

Detailed Description

Title box for showing titles with optional unit.

Inherits CDPBaseContainer and CDPBaseWidget and thus all of their properties like background image or border pixmap and margins.

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).

Main element structure

The following tree shows the svg structure that can be used on the CDPBaseTitle.

svg
└─── Layer1
      ├─── cdpTextUnit                (text)
      ├─── cdpTextTitle               (text)
      ├─── cdpBorderMarginTopLeft     (transparent rect/path)
      ├─── cdpBorderMarginBottomRight (transparent rect/path)
      └─── cdpBackground              (element group)
            ├─── < Path >             (transparent rect/path)
            └─── < Group >            (background graphics)

Note: Elements that are written with pointy brackets, like < Path >, can be given any name. Avoid cdp prefix as these are special to the parser.

The following table explains the named elements in more detail.

PropertyTypeDescription
cdpTextUnittextThe color and size of the font to be used on the unit text.
cdpTextTitletextThe color and size of the font to be used on the title text.
cdpBorderMarginTopLeftrectTransparent rectangle that specifies the left border margin by its width and the top border margin by its height.
cdpBorderMarginBottomRightrectTransparent rectangle that specifies the right border margin by its width and the bottom border margin by its height.
cdpBackgroundrect or an element group containing a rectThe cdpBackground should contain the actual background graphics. To ensure that the svg parser gets the correct background size (and aspect ratio), we have to place a transparent rect along with the graphics within a group element.

Style element structure

The title supports the following structure for styles.

svg
└─── Styles
      ├─── cdpTextUnitStyleX      (text)
      ├─── cdpTextTitleStyleX     (text)
      └─── cdpBackgroundStyleX    (element group)
            ├─── < Path >         (transparent rect/path)
            └─── < Group >        (background graphics)

Property Documentation

cdpStyleRouting : QString

This property holds the routing to the cdp object that is used to change the widget svg style.

Access functions:

QString cdpStyle()
void setCdpStyle(QString routing)

titleText : QString

This property holds the title text (top).

Access functions:

virtual QString titleText()
virtual void setTitleText(QString text)

unitText : QString

This property holds the unit text (bottom).

Access functions:

virtual QString unitText()
virtual void setUnitText(QString text)

See also unitTextShow.

unitTextShow : bool

This property holds whether to show or hide unit text.

Access functions:

virtual bool showUnitText()
virtual void setShowUnitText(bool show)

See also unitText.

Member Function Documentation

CDPBaseTitle::CDPBaseTitle(QWidget *parent = 0)

Default constructs an instance of CDPBaseTitle.

[override virtual protected] void CDPBaseTitle::processSvgFile(QString svg)

[virtual slot] void CDPBaseTitle::setWidgetFont(const QString &font)

[virtual slot] void CDPBaseTitle::setWidgetStyle(int style)

[virtual slot] void CDPBaseTitle::updateSvgFont(bool skipSize = false)

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