Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Best way to create a thumbnail viewer

    General and Desktop
    2
    3
    2012
    Loading More Posts
    • 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.
    • K
      krosseland last edited by

      Hi,

      I need to create a thumbnail viewer where the images are stored as QByteArray (I convert this to QPixmap and QImage). I have successfully created a thumbnail viewer using a QListWidget that I add QListWidgetItems to (see code below).

      @
      QIcon thumnail = QIcon(Pixmap::fromImage(image));
      QListWidgetItem* newItem= new QListWidgetItem(ui_.thumbnailWindow);
      // ui_.thumbnailWindow is a QListWidget added in design mode

      newItem->setText(“some text”);
      newItem->setIcon(thumbnail);
      @

      However, I am having problems updating this QListWidget when I want so I would like to try something else. Have any of you any suggestions?

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User last edited by

        Hi,

        bq. I am having problems updating this QListWidget when I want

        What's exactly the problem?

        1 Reply Last reply Reply Quote 0
        • K
          krosseland last edited by

          see my other post "My QListWidget is not updating when I want"....

          I have connected a signal to a slot. In the slot the QListWidget is cleared before the newItems are added to the QListWidget.

          I have verified that the slot is actually activated by using QDebug()... So it is just the screen that is not updated. The signal is emitted from a Widget #1 and the slot is for a Widget #2....

          Did you understand the problem? Are signals and slots not thread safe?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post