Results 1 to 2 of 2

Thread: Showing Pixmap as a QListWidget Item

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Showing Pixmap as a QListWidget Item

    Hi, so are you using resources? Do you have a .qrc file?

    If you are using resources it should be something more like this:
    Qt Code:
    1. QPixmap NoPreViewpix(":/images/NoPreView.png");
    To copy to clipboard, switch view to plain text mode 
    Resources are compiled into the application binary.

    If you are not using resources, the more appropriate way would be:
    Qt Code:
    1. QPixmap NoPreViewpix(QApplication::applicationDirPath() + "/images/NoPreView.png");
    To copy to clipboard, switch view to plain text mode 
    Notice the missing ":" (used only with resources). In addition, the current working directory might not be reliable as it's not necessarily the same directory where the application binary is located in.
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    vishal.chauhan (2nd February 2007)

Similar Threads

  1. Replies: 13
    Last Post: 15th December 2006, 11:52
  2. Replies: 3
    Last Post: 7th November 2006, 08:35
  3. Reg - add item in QListWidget
    By suresh in forum Newbie
    Replies: 1
    Last Post: 1st September 2006, 17:52
  4. extract item from QListWidget
    By impeteperry in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2006, 19:41
  5. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.