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 469 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 12 Oct 2023, 06:57 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
      17 Oct 2023, 03:10

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

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Oct 2023, 20:21 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 20 Oct 2023, 09:35
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 12 Oct 2023, 19:54 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 17 Oct 2023, 03:10
        0
        • S SGaist
          12 Oct 2023, 19:54

          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 17 Oct 2023, 03:10 last edited by
          #3

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

          S 1 Reply Last reply 18 Oct 2023, 20:21
          0
          • Q Quella
            17 Oct 2023, 03:10

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

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 18 Oct 2023, 20:21 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 20 Oct 2023, 09:35
            0
            • S SGaist
              18 Oct 2023, 20:21

              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 20 Oct 2023, 09:35 last edited by
              #5

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

              J 1 Reply Last reply 20 Oct 2023, 11:30
              0
              • Q Quella
                20 Oct 2023, 09:35

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

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 20 Oct 2023, 11:30 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 23 Oct 2023, 01:57
                3
                • J jsulm
                  20 Oct 2023, 11:30

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

                  Q Offline
                  Q Offline
                  Quella
                  wrote on 23 Oct 2023, 01:57 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 23 Oct 2023, 01:57

                  1/7

                  12 Oct 2023, 06:57

                  • Login

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