PDA

View Full Version : Qt label to image.



vProgramm
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!

10906

d_stranz
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.

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.

Cheers,
_

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