Results 1 to 4 of 4

Thread: Qt label to image.

  1. #1
    Join Date
    Jan 2015
    Posts
    5
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Question Qt label to image.

    Hello. I did a menu with some box with images, on design appear the images but on compiler not appear. I tryed use QPixMap but resulted in errors, look bellow the errors:

    Sorry for my english. I'm brazilian and i'm studing english!

    Sem tÃ*tulo.jpg

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt label to image.

    Don't you know that in C++, strings with embedded backslash characters have to be written as "\\" and not "\"?

    Any two-character sequence starting with "\" is called an "escape sequence", and the character that follows the "\" has to be a valid escape character, like "\n", "\t", etc. That is what the compiler is telling you - "\U", "\D", etc. are not valid escape sequences.

    Replace every "\" with "\\" and it will compile.

    Edit: or do as anda_skoa says below: Replace every "\" with "/". Thanks for reminding me, anda_skoa.
    Last edited by d_stranz; 26th January 2015 at 23:15.

  3. The following user says thank you to d_stranz for this useful post:

    vProgramm (27th January 2015)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt label to image.

    Or even better use forward slashes in paths, no need to make the code more unreadable just because Microsoft tries to be as incompatible with the rest of the world as possible.
    Qt can take care of the conversion on Windows.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    vProgramm (27th January 2015)

  6. #4
    Join Date
    Jan 2015
    Posts
    5
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Qt label to image.

    thanks brothers. problem resolved!

Similar Threads

  1. Creating a Morph Image in Label
    By 2lights in forum Qt Programming
    Replies: 2
    Last Post: 18th July 2013, 08:07
  2. HOW TO DISPLAY A RECTANGLE ON AN IMAGE on a label
    By qt_user in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2010, 15:19
  3. Replies: 5
    Last Post: 16th December 2009, 11:33
  4. Replies: 1
    Last Post: 23rd May 2009, 09:04
  5. label with image and text
    By mattia in forum Newbie
    Replies: 1
    Last Post: 7th March 2008, 11:28

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.