[Qt-interest] how to stop slideshow.
R. Reucher
rene.reucher at batcom-it.net
Fri Feb 13 10:36:25 CET 2009
On Fri February 13 2009 10:27:09 Avishek_Sharma wrote:
> pic_dis::slideshow()
> {
> pic_dis::next_pic();
> QTimer *timer = new QTimer(this);
> connect( timer, SIGNAL(timeout()), SLOT(slideshow()) );
> timer->start( 950, TRUE );
> }
>
> **next_pic is a slot which is called when the 'Next Photo>>' button is
> clicked.I am calling that slot from the slideshow() slot.
Every time the slideshow() slot is called, a new QTimer instance will be
created. I guess what you really want is to create that QTimer once (within
the pic_dis class) and just call QTimer::start().
Or if you want to use a single-shot timer you can forget afterwards, use
QTimer::singleShot() instead!
Also, consider using Qt 4.4+!
HTH, René
--
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
The trouble with being punctual is that people think you have nothing
more important to do.
More information about the Qt-interest-old
mailing list