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. Best way to create a thumbnail viewer
Forum Updated to NodeBB v4.3 + New Features

Best way to create a thumbnail viewer

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.3k Views 1 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.
  • K Offline
    K Offline
    krosseland
    wrote on last edited by
    #1

    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
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,

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

      What's exactly the problem?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        krosseland
        wrote on last edited by
        #3

        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
        0

        • Login

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