Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to implement an image control that displays network images and supports loading state.
Forum Updated to NodeBB v4.3 + New Features

How to implement an image control that displays network images and supports loading state.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 406 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quella
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • Q Quella

      @SGaist Thank you for your answer! May I ask if there are any open source projects that can be referenced?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        0
        • SGaistS SGaist

          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.

          Q Offline
          Q Offline
          Quella
          wrote on last edited by
          #3

          @SGaist Thank you for your answer! May I ask if there are any open source projects that can be referenced?

          SGaistS 1 Reply Last reply
          0
          • Q Quella

            @SGaist Thank you for your answer! May I ask if there are any open source projects that can be referenced?

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            Q 1 Reply Last reply
            0
            • SGaistS SGaist

              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.

              Q Offline
              Q Offline
              Quella
              wrote on last edited by
              #5

              @SGaist Thanks for your reply! Would it be better to use QPixmap rather than QLabel here?

              jsulmJ 1 Reply Last reply
              0
              • Q Quella

                @SGaist Thanks for your reply! Would it be better to use QPixmap rather than QLabel here?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @Quella QPixmap is not a widget, so cannot be shown directly in UI

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q 1 Reply Last reply
                3
                • jsulmJ jsulm

                  @Quella QPixmap is not a widget, so cannot be shown directly in UI

                  Q Offline
                  Q Offline
                  Quella
                  wrote on last edited by
                  #7

                  @jsulm I see. Thank you for your reply.

                  1 Reply Last reply
                  0
                  • Q Quella has marked this topic as solved on

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved