Results 1 to 6 of 6

Thread: Unicode in QmessageBox?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    129
    Thanked 3 Times in 3 Posts

    Question Unicode in QmessageBox?

    I want to put a qmessagebox that contains greek characters...
    Something like this:
    Qt Code:
    1. QMessageBox msgBox;
    2. msgBox.setWindowTitle("Wallpaper Changer | Βγάλε Webcam-Εικόνα");
    3. msgBox.setText("<b>Αυτή η λειτουργία θα είναι διαθÎ*σιμη στην<br>επόμενη Î*κδοση...</b>");
    4. msgBox.setIconPixmap(QIcon(":/icons/Pictures/Webcam.png").pixmap(QSize(128,128)));
    5. msgBox.setWindowIcon(QIcon(":/icons/Pictures/Webcam.png"));
    6. msgBox.exec();
    To copy to clipboard, switch view to plain text mode 
    But I get Chinese/strange symbols and not the greek ones I expected. How can this solved ?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Unicode in QmessageBox?

    Use proper encoding for your source file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    129
    Thanked 3 Times in 3 Posts

    Default Re: Unicode in QmessageBox?

    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!
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Unicode in QmessageBox?

    What is the current encoding of the source file containing the greek characters?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    129
    Thanked 3 Times in 3 Posts

    Default Re: Unicode in QmessageBox?

    msgBox.setWindowTitle(QString::fromUtf8("Aνα νÎ*ωση"))
    Lol it was that simple and you couldn't even answer. You can misguide somebody with your answers!
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Unicode in QmessageBox?

    Quote Originally Posted by hakermania View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Unicode strings int Qt 4.2.1
    By mkrentovskiy in forum Qt Programming
    Replies: 12
    Last Post: 29th December 2011, 09:02
  2. QString and Unicode
    By juanjo_de_la_pradera in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2010, 13:38
  3. [disable unicode]
    By tri407tiny in forum Newbie
    Replies: 3
    Last Post: 5th May 2010, 02:20
  4. Unicode
    By qtuser20 in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2009, 21:43
  5. source in unicode 4.0
    By conexion2000 in forum Qt Programming
    Replies: 1
    Last Post: 10th August 2007, 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
  •  
Qt is a trademark of The Qt Company.