qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] how to stop slideshow.

Subject: Re: [Qt-interest] how to stop slideshow.
From: "R. Reucher"
Date: Fri, 13 Feb 2009 10:36:25 +0100
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@xxxxxxxxxxxxx
http://www.batcom-it.net/

The trouble with being punctual is that people think you have nothing
more important to do.

_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>