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

Compability class. More...

#include <ThreadedUpdatableSlider.h>

List of all members.

Classes

struct  CB
 internally callback type More...

Public Member Functions

 ThreadedUpdatableSlider (QWidget *parent=0)
 Base constructor.
 ThreadedUpdatableSlider (Qt::Orientation o, QWidget *parent=0)
void setValueFromOtherThread (int value)
 call this function to update a widget's UI from an external thread
virtual bool event (QEvent *event)
 automatically called by Qt's event processing mechanism
void registerCallback (const utils::Function< void > &cb, const std::string &events="value")
 registers a void-callback function to the given event names
void removeCallbacks ()
 removes all callbacks associated to this slider component

Protected Slots

void collectValueChanged (int)
 for collecting slider singnals
void collectSliderPressed ()
 for collecting slider singnals
void collectSliderMoved (int)
 for collecting slider singnals
void collectSliderReleased ()
 for collecting slider singnals

Private Attributes

std::vector< CBcallbacks
 internal list of callbacks

Detailed Description

Compability class.

This class provides a compability function for asyncronous updating of a QWidget. As QWidget::update() has shown to be not as threadsafe as expected, the new updateFromOtherThread function fixes this problem.

updateFromOtherThread used QApplication::postEvent, to post a UserType QEvent to this object, which is caught in the overloaded event() function


Constructor & Destructor Documentation

Base constructor.

icl::qt::ThreadedUpdatableSlider::ThreadedUpdatableSlider ( Qt::Orientation  o,
QWidget *  parent = 0 
)

Member Function Documentation

void icl::qt::ThreadedUpdatableSlider::collectSliderMoved ( int  ) [protected, slot]

for collecting slider singnals

for collecting slider singnals

for collecting slider singnals

for collecting slider singnals

virtual bool icl::qt::ThreadedUpdatableSlider::event ( QEvent *  event) [inline, virtual]

automatically called by Qt's event processing mechanism

void icl::qt::ThreadedUpdatableSlider::registerCallback ( const utils::Function< void > &  cb,
const std::string &  events = "value" 
)

registers a void-callback function to the given event names

allowed event names are

  • press (when the slider is pressed)
  • release (when the slider is released)
  • move (when the slider is moved)
  • value (when the value is changed)
  • all (for all events)

removes all callbacks associated to this slider component

call this function to update a widget's UI from an external thread

new, if this is called from the GUI thread, setValue is called directly without using Qt's signal mechanism


Member Data Documentation

internal list of callbacks


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