How to implement an image control that displays network images and supports loading state.
-
May I ask if there is such a control now? If not, which control can be used to implement it: supporting the display of images by setting the URL and showing loading state during the image download process. Once the download is successful, the loading state disappears, and the downloaded image is displayed.
-
One possible simple implementation could be a QStackedWidget with an infinite QProgressBar as first widget and one QLabel to show the image as the second one.
When you start the download, you set the progress bar as current widget and when the download is done, you load the image in the QLabel and set it as current widget.
-
Hi,
If you are thinking of a pre-made widget in the Qt framework, then, no. You will have to implement that yourself.
Note that maybe KDE has something.
-
One possible simple implementation could be a QStackedWidget with an infinite QProgressBar as first widget and one QLabel to show the image as the second one.
When you start the download, you set the progress bar as current widget and when the download is done, you load the image in the QLabel and set it as current widget.
-