Results 1 to 11 of 11

Thread: [Qt 4.6.3] : pixmap resource for a label

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [Qt 4.6.3] : pixmap resource for a label

    Hello everyone,


    I wanted to associate a pixmap to a QLabel.
    For that, I trusted Qt Designer.
    I declared my pixmap to a qt resource file
    and then have associated with my famous QLabel.

    uic generates the following line:


    Qt Code:
    1. stateIndicator-> setPixmap (QPixmap (QString:: fromUtf8 (":/icons/amber-on.ico")));
    To copy to clipboard, switch view to plain text mode 

    To me, it seems correct.

    The compilation of the application goes smoothly.
    Note: that the .cpp generated by rcc is well taken into account by the compilation chain.
    However, the pixmap does not appear in place of the label.

    Qt may dislike the ICO format. Never mind, I converted to PNG.
    Still nothing but a construction error since each time the pixmap, QLabel:: pixmap () -> isNull () is true.

    I give up the resource file to associate the file directly. Ico to my label.
    And then I'll give you a thousand, it works!

    However, I missed something?? ... Or is it a bug in Qt ? In any case, I saw nothing of this kind, reported.
    Last edited by didier; 15th September 2010 at 16:07.

Similar Threads

  1. Change the size of pixmap in a label
    By metRo_ in forum Qt Programming
    Replies: 16
    Last Post: 1st June 2012, 10:21
  2. label - pixmap - problem
    By qwrhiobasdbgghoasdf in forum Newbie
    Replies: 5
    Last Post: 16th September 2010, 00:29
  3. XML resource is garbled?
    By space_otter in forum Qt Programming
    Replies: 8
    Last Post: 22nd June 2010, 01:09
  4. How do i change images? Qt creator label>pixmap
    By QueenZ in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2010, 04:44
  5. Qt Resource and StyleSheet Help
    By Peter_APIIT in forum Newbie
    Replies: 0
    Last Post: 19th September 2009, 06:25

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.