PDA

View Full Version : Unicode in QmessageBox?



hakermania
5th November 2010, 20:27
I want to put a qmessagebox that contains greek characters...
Something like this:

QMessageBox msgBox;
msgBox.setWindowTitle("Wallpaper Changer | Βγάλε Webcam-Εικόνα");
msgBox.setText("<b>Αυτή η λειτουργία θα είναι διαθÎ*σιμη στην<br>επόμενη Î*κδοση...</b>");
msgBox.setIconPixmap(QIcon(":/icons/Pictures/Webcam.png").pixmap(QSize(128,128)));
msgBox.setWindowIcon(QIcon(":/icons/Pictures/Webcam.png"));
msgBox.exec();
But I get Chinese/strange symbols and not the greek ones I expected. How can this solved ?:confused:

wysota
5th November 2010, 21:55
Use proper encoding for your source file.

hakermania
6th November 2010, 17:40
I don't think so it's suck a big deal! I think I should just use something like .toUtf8 or something like this but I dont know exactly what! :(

wysota
6th November 2010, 17:56
What is the current encoding of the source file containing the greek characters?

hakermania
7th November 2010, 00:15
msgBox.setWindowTitle(QString::fromUtf8("AνανÎ*ωση"))
Lol it was that simple and you couldn't even answer. You can misguide somebody with your answers!

wysota
7th November 2010, 00:24
msgBox.setWindowTitle(QString::fromUtf8("AνανÎ*ωση"))
Lol it was that simple and you couldn't even answer. You can misguide somebody with your answers!

If you answered "UTF-8" I would have told you to use QObject::trUtf8() right in the next post.