Is there any simple loading indicator widget, to show some work-in-progress, something like a rotating dots in a circle or so? Something like this:
Asked
Active
Viewed 3.3k times
28
-
Someone developed such widget here: https://github.com/mojocorp/QProgressIndicator This is a widget painting exactly what you need. Please note the animation is created by the code, is not an animated gif. This have the advatnage you can resize the widget as you prefer without loose definiton. – Suppaman Dec 13 '16 at 13:21
-
1https://github.com/snowwlex/QtWaitingSpinner works, once the question is reopened, I can put in a complete answer on its usage. – phyatt Sep 01 '17 at 13:46
1 Answers
62
No, there is no such widget, but there is another very simple way to do this. You can play gif animation to do this. For example:
QLabel *lbl = new QLabel;
QMovie *movie = new QMovie("G:/loader.gif");
lbl->setMovie(movie);
lbl->show();
movie->start();
You can get gif-animation from here or use another gif.
I think that it is the easiest way because you can create this animation in app with timer, color changing and so on, but it requires a lot of work and time. But QMovie
is powerful and easy to use class.

Jablonski
- 18,083
- 2
- 46
- 47
-
9remember to destroy movie. From [doc](http://doc.qt.io/qt-5/qlabel.html#setMovie): "The label does NOT take ownership of the movie." – n3mo Aug 30 '17 at 13:40
-
1
-
On the comment "there is no such widget": Actually, several were posted here, but the answers were deleted because they are against StackOverflow policies to post just links. – Albert Feb 05 '19 at 08:34