Results 1 to 2 of 2

Thread: Can I translate data with GUI element.

  1. #1
    Join Date
    Mar 2008
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Can I translate data with GUI element.

    Hi everybody, I want to add into my application a Translation menu which change the current langage to the selected one. For the GUI element and user messages, there's no problem, I will use QtLinguist. But I wann to change whith thme the data. There's any methode to translate the data when I change the langage. Can anyone tell me how to do this konwing that I dispose in my database of all the data in the different langages.
    Best regards.

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

    Default Re: Can I translate data with GUI element.

    QObject::tr() is the way to go. Wrap every user visible string in it and then run lupdate as usual and do the translation. Then make sure you handle the QEvent::LanguageChange event for each of the classes and retranslate all strings there (Designer generated classes use the retranslateUi() method for this).

Similar Threads

  1. QSqlQueryModel data update
    By psi in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2012, 03:59
  2. Replies: 4
    Last Post: 19th October 2007, 19:47
  3. Data model
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2007, 12:14
  4. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.