cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
Public Member Functions | Protected Attributes | Properties | List of all members
ELabel Class Reference

A label that can be used to display numeric, boolean or enum values. More...

#include <elabel.h>

Inheritance diagram for ELabel:
Inheritance graph
[legend]

Public Member Functions

 ELabel (QWidget *parent)
 
virtual ~ELabel ()
 
void setValue (QVariant v, bool ref=true)
 
QVariant value () const
 
void setBooleanDisplay (QString, QString, QColor, QColor)
 
void setEnumDisplay (unsigned int value, QString label, QColor color)
 Assigns a label and a color to a particular value. More...
 
void setTrueString (QString s)
 
QString trueString () const
 
void setFalseString (QString s)
 
QString falseString () const
 
void setTrueColor (QColor c)
 
QColor trueColor () const
 
void setFalseColor (QColor c)
 
QColor falseColor () const
 
bool enumDisplayConfigured ()
 
void clearEnumDisplay ()
 
void display ()
 
- Public Member Functions inherited from QuLabelBase
 QuLabelBase (QWidget *parent)
 
 QuLabelBase (const QString &text, QWidget *parent)
 
virtual ~QuLabelBase ()
 
void setBackground (const QColor &background)
 set the background color of the label More...
 
void setBorderColor (const QColor &border)
 changes the border color More...
 
void setDecoration (const QColor &background, const QColor &border)
 changes the colors for the decoration of the label More...
 
double borderWidth () const
 returns the width, in pixels, of the colored border that is drawn around the label More...
 
void setEnumDisplay (int val, const QString &text, const QColor &c)
 
int maximumLength () const
 returns the maximum length of the displayed string More...
 
QSize minimumSizeHint () const override
 reimplements QLabel::minimumSizeHint to ensure there is enough space to draw the decorations on the border More...
 
QSize sizeHint () const override
 
int heightForWidth (int w) const override
 
bool hasHeightForWidth () const override
 
bool drawInternalBorder () const
 if enabled, an external and an internal border are drawn More...
 
QString format () const
 returns the format used to represent a number, or an empty string if no format is specified More...
 

Protected Attributes

QVariant val
 
QVector< unsigned int > v_values
 
QVector< QColor > v_colors
 
QVector< QString > v_strings
 

Properties

QColor trueColor
 
QColor falseColor
 
QString trueString
 
QString falseString
 
- Properties inherited from QuLabelBase
double borderWidth
 
bool drawInternalBorder
 
QString format
 

Additional Inherited Members

- Public Slots inherited from QuLabelBase
void setBorderWidth (double w)
 sets the width of the border(s) drawn with the chosen color More...
 
void setDrawInternalBorder (bool draw)
 
void setValue (const CuVariant &d, bool *background_modified=NULL)
 set the value to display on the label. Optionally check if the background color has been modified by the method More...
 
void setFormat (const QString &fmt)
 
void setMaximumLength (int len)
 if the data shown is a string, truncate it to the given length More...
 
- Protected Member Functions inherited from QuLabelBase
void paintEvent (QPaintEvent *pe) override
 Reimplements QLabel::paintEvent. More...
 

Detailed Description

A label that can be used to display numeric, boolean or enum values.

Constructor & Destructor Documentation

◆ ELabel()

ELabel::ELabel ( QWidget *  parent)

◆ ~ELabel()

ELabel::~ELabel ( )
virtual

Member Function Documentation

◆ clearEnumDisplay()

void ELabel::clearEnumDisplay ( )

References v_colors, v_strings, and v_values.

◆ display()

void ELabel::display ( )

◆ enumDisplayConfigured()

bool ELabel::enumDisplayConfigured ( )

References v_values.

◆ falseColor()

QColor ELabel::falseColor ( ) const

◆ falseString()

QString ELabel::falseString ( ) const

◆ setBooleanDisplay()

void ELabel::setBooleanDisplay ( QString  fS,
QString  tS,
QColor  fC,
QColor  tC 
)

References display().

◆ setEnumDisplay()

void ELabel::setEnumDisplay ( unsigned int  value,
QString  label,
QColor  color 
)

Assigns a label and a color to a particular value.

The tango attribute must not have a display unit for this to work correctly.

References display(), v_colors, v_strings, v_values, and value().

◆ setFalseColor()

void ELabel::setFalseColor ( QColor  c)

References display().

◆ setFalseString()

void ELabel::setFalseString ( QString  s)

References display().

◆ setTrueColor()

void ELabel::setTrueColor ( QColor  c)

References display().

◆ setTrueString()

void ELabel::setTrueString ( QString  s)

References display().

◆ setValue()

void ELabel::setValue ( QVariant  v,
bool  ref = true 
)

References display().

◆ trueColor()

QColor ELabel::trueColor ( ) const

◆ trueString()

QString ELabel::trueString ( ) const

◆ value()

QVariant ELabel::value ( ) const

Referenced by setEnumDisplay().

Member Data Documentation

◆ v_colors

QVector<QColor> ELabel::v_colors
protected

◆ v_strings

QVector<QString> ELabel::v_strings
protected

◆ v_values

QVector<unsigned int> ELabel::v_values
protected

◆ val

QVariant ELabel::val
protected

Property Documentation

◆ falseColor

QColor ELabel::falseColor
readwrite

◆ falseString

QString ELabel::falseString
readwrite

◆ trueColor

QColor ELabel::trueColor
readwrite

◆ trueString

QString ELabel::trueString
readwrite

The documentation for this class was generated from the following files: