Need to make QLCDNumber display count up/down
Hi, I need to be able to set my QLCDNumber to a new value and have it count up or count down to that new value on screen.
Is the best way to do that by connecting the new value to an invisible QSlider first, then connecting the slider value to the QLCDNumber? Or is there a more direct way?
Thanks for any help you can give!
Re: Need to make QLCDNumber display count up/down
How about:
Code:
public:
X(...) : ... {...}
void countFrom(int tim){
left = tim;
startTimer(1000);
display(left);
}
protected:
if(--left==0)
killTimer(e->timerId());
display(left);
}
private:
int left;
};
Re: Need to make QLCDNumber display count up/down
Nice solution. Thanks for that!