PDA

View Full Version : How can i add a ProgressIndicator to my programm?



Bong.Da.City
23rd August 2010, 20:41
I recently had seen this (http://qt-apps.org/content/show.php/QProgressIndicator?content=115762) app.. It is ProgressIndicator and it is very cool.. I had made a program that change the wallpaper on ubuntu..

http://i33.tinypic.com/2agrcjm.jpg

So when the button start is clicked the wallpaper is changing... When you click stop it stops changing the wallpaper... How can i have the ProgressIndicator i mention above when the wallpapers are changing... ?

iunknwn
23rd August 2010, 21:36
Find a place in your MainWindow widget, where you want to stick your QProgressIndicator widget or just bring it up as a modal dialog.


QProgrssIndicator* piObj = new QProgressIndicator(this);
piObj->setAnimationDelay(40);
piObj->setDisplayedWhenStopped(false);
piObj->setColor(QColor(Qt::Red));
connect(startButton, SIGNAL(clicked()), piObj, SLOT(startAnimation());
connect(stopButton, SIGNAL(clicked()), piObj, SLOT(stopAnimation());