Results 1 to 2 of 2

Thread: Translations for tool tips don't show up

  1. #1

    Default Translations for tool tips don't show up

    Hello,

    I'm relatively new to Qt and I'm having some problems with the translations of my tool tips into other languages.
    I've written a method that sets the tool tips on start up. Afterwards I'm loading my .qm file with the translations
    and set up the translator. This works fine for everything that isn't a tooltip; all texts are translated, only the tool tips
    are shown in the original language.
    The tool tip texts are also contained in the .ts file, a translation is available, but it just doesn't use the translation when
    I change the language.

    Does anyone have an idea what could be causing this?

    I added a part of the of the method that sets my tool tips. All my tool tips are set in this way.

    Qt Code:
    1. void MainWindow::InitToolTips(void) // Set Tool-tips
    2. {
    3. const QString TStart = "<b><span style=\"color:green;\">";
    4. const QString TEnd = "</span></b>";
    5.  
    6. ui->btn_StartTab->setToolTip(TStart + tr("Kopieren von Einstellungen zwischen Drehmomentschlüssel und Datenbank") + TEnd);
    7. ui->btn_WrenchTab->setToolTip(TStart + tr("Einstellungen für aktuell angeschlossenen Drehmomentschlüssel") + TEnd);
    8. ui->btn_ProgramsTab->setToolTip(TStart + tr("Schraubfälle und Ablaufpläne verwalten") + TEnd);
    9. ui->btn_DataTab->setToolTip(TStart + tr("In die Datenbank geladene Verschraubungsdaten verwalten") + TEnd);
    10. ui->btn_Workflows->setToolTip(TStart + tr("Einstellen von Premium-Workflows") + TEnd);
    11. ui->btn_LiveMode->setToolTip(TStart + tr("Live-Anzeige aktivieren") + TEnd);
    12. ui->tbtn_ProgramSettings->setToolTip(TStart + tr("Zeige den Dialog zur Programmkonfiguration") + TEnd);
    13. ui->tbtn_RadioConfig->setToolTip(TStart + tr("Zeige den Dialog zur Funkschnittstelle") + TEnd);
    14. ui->tbtn_Help->setToolTip(TStart + tr("Zeige die Programmhilfedatei an") + TEnd);
    15. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Translations for tool tips don't show up

    Quote Originally Posted by magicp7 View Post
    The tool tip texts are also contained in the .ts file, a translation is available, but it just doesn't use the translation when
    I change the language.
    You mean you change the language after these "setToolTip" methods have been executed?
    If so, how would that code miraculously run again?

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 8th May 2014, 16:57
  2. Replies: 6
    Last Post: 6th February 2013, 07:28
  3. Replies: 1
    Last Post: 4th December 2011, 14:58
  4. Grouping of Tool buttons in Tool bar
    By febil in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2009, 11:51
  5. Need some debugging tips for Qt
    By montylee in forum Qt Programming
    Replies: 4
    Last Post: 17th March 2009, 22:05

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.