CDPBaseTitle Class
Title box for showing titles with optional unit. More...
Header: | #include <CDPBaseWidgets/CDPBaseTitle.h> |
Inherits: | CDPBaseContainer |
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.
Property | Type | Description |
---|---|---|
cdpTextUnit | text | The color and size of the font to be used on the unit text. |
cdpTextTitle | text | The color and size of the font to be used on the title text. |
cdpBorderMarginTopLeft | rect | Transparent rectangle that specifies the left border margin by its width and the top border margin by its height. |
cdpBorderMarginBottomRight | rect | Transparent rectangle that specifies the right border margin by its width and the bottom border margin by its height. |
cdpBackground | rect or an element group containing a rect | The 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)
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.