Monday, 9 September 2013

displaying QSlider value in QLabel using QThread

displaying QSlider value in QLabel using QThread

I am implementing a simple function where the slider value is constantly
displayed on label and qDebug(). I already got the label updated using
signal/slots, but somehow the qDebug() thread is not working properly. I
expected to see the console flooded with the value of the slider.
Below is my code:
// SliderThread.h:
class HorizontalSliderThread : public QThread {
Q_OBJECT
public:
HorizontalSliderThread(Ui::MainWindow *ui);
~HorizontalSliderThread();
public slots:
void process();
signals:
void finished();
void error(QString err);
private:
int value;
};

No comments:

Post a Comment