Results 1 to 2 of 2

Thread: How to mark a string in Qt Desginer (e.g. a QLabel) as not translatable

  1. #1

    Question How to mark a string in Qt Desginer (e.g. a QLabel) as not translatable

    I'm using Qt Designer 4.6 to create all dialogs in our application. This application is multilingual and allows the user to switch the language at runtime. When the language changes, I install a new QTranslater using QApplication::installTranslator(). Because of this, Qt automatically generates a LanguageChange event, which is sent to all top-level widgets. see also http://doc.trolltech.com/4.6/interna...ic-translation. When I receive a LanguageChange event, I simply call function retranslateUi(this), which is generated by designer. This function simply sets the text property on all widgets again. So far so good.

    The problem is, that this approach doesn't work for widgets, whose text property is filled with a specific value which is determinated at runtime. E.g. I have an about dialog which shows the firmware version number of a connected mobile phone. If this about dialog is open, and the user changes the language at the same time, the version number field will be overwritten, with the "place-holder" string which I have enetered in Qt designer. Also the place-holder string appears in Qt Linguist.

    Is there a smart way, to mark widgets in Qt designer, so that they are not automatically translated. Or with other words, that designer doesn't enclose those strings in QApplication::translate()

    Thx

  2. #2
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to mark a string in Qt Desginer (e.g. a QLabel) as not translatable

    Did you try to remove the tick mark in the checkbox named 'translatable' in the 'text' property of the QLabel in Designer's Property Editor?

Similar Threads

  1. how can i mark points on top of a Image?
    By montamer in forum Qt Programming
    Replies: 2
    Last Post: 2nd April 2010, 13:53
  2. Replies: 1
    Last Post: 29th September 2009, 20:44
  3. Replies: 6
    Last Post: 21st September 2009, 11:55
  4. Qlabel size string too long
    By Pharell in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2008, 16:20
  5. qt desginer 4.2.2 problem on win_xp_sp2
    By eemil in forum Installation and Deployment
    Replies: 2
    Last Post: 28th December 2006, 13:57

Tags for this Thread

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.