View Full Version : Qt label to image.

26th January 2015, 19:51
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!


26th January 2015, 20:39
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.

26th January 2015, 21:34
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.


27th January 2015, 01:34
thanks brothers. problem resolved!