Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::qt::ColorLabel Class Reference

Utility class to avoid Qt warning when accesing QLabels from differnt Threads. More...

#include <ColorLabel.h>

Inheritance diagram for icl::qt::ColorLabel:
icl::qt::ThreadedUpdatableWidget

List of all members.

Public Member Functions

 ColorLabel (core::Color4D &color, bool useAlpha, QWidget *parent=0)
 Create a new label with given text and given parent widget.
virtual void paintEvent (QPaintEvent *evt)
 reimplemented drawin function (draw the current text centered)
void setColor (const core::Color &color)
 sets new color rgb
void setColor (const core::Color4D &color)
 sets new color rgba
core::Color getRGB () const
 returns current color
core::Color4D getRGBA () const
 returns current rgba color
int getRed () const
 returns current red value
int getGreen () const
 returns current green value
int getBlue () const
 returns current blue value
int getAlhpa () const
 return current alpha value
bool hasAlpha () const
 returns wheter internal color uses alpha value

Private Attributes

core::Color4Dm_color
 shallowly wrapped color
bool m_hasAlpha
 indicator wheter alpha is used
QMutex m_oMutex
 Thread-safety mutex.

Detailed Description

Utility class to avoid Qt warning when accesing QLabels from differnt Threads.

QLabels can not be used from different Threads. So if a QLabel is created in in the main thread, it might not be set up to show another text/number from the working thread. As a workaround, the "label" component of the ICL GUI API uses not the original QLabel but this thread-save reimplementation called CompabilityLabel.


Constructor & Destructor Documentation

icl::qt::ColorLabel::ColorLabel ( core::Color4D color,
bool  useAlpha,
QWidget *  parent = 0 
)

Create a new label with given text and given parent widget.


Member Function Documentation

return current alpha value

returns current blue value

returns current green value

returns current red value

returns current color

returns current rgba color

returns wheter internal color uses alpha value

virtual void icl::qt::ColorLabel::paintEvent ( QPaintEvent *  evt) [virtual]

reimplemented drawin function (draw the current text centered)

void icl::qt::ColorLabel::setColor ( const core::Color color)

sets new color rgb

sets new color rgba


Member Data Documentation

shallowly wrapped color

indicator wheter alpha is used

QMutex icl::qt::ColorLabel::m_oMutex [mutable, private]

Thread-safety mutex.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines