Results 1 to 2 of 2

Thread: The difference between tr and translate

  1. #1
    Join Date
    Jul 2014
    Posts
    95
    Thanks
    67

    Default The difference between tr and translate

    Hi
    What is the difference between tr and translate in the code?
    thanks

  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: The difference between tr and translate

    http://qt-project.org/doc/qt-5/qcore...html#translate

    Returns the translation text for sourceText, by querying the installed translation files. The translation files are searched from the most recently installed file back to the first installed file.
    QObject::tr() provides this functionality more conveniently.
    Basically QObject::tr() automatically provides the "context" argument for QCoreApplication::translate()

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    rezas1000 (15th August 2014)

Similar Threads

  1. Translate my app (dynamic)
    By liran ritkop in forum Qt Programming
    Replies: 6
    Last Post: 31st March 2011, 10:25
  2. Dynamic Translate
    By liran ritkop in forum Qt Programming
    Replies: 14
    Last Post: 30th March 2011, 12:22
  3. translate and qgraphicsitem
    By pb in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2009, 05:25
  4. translate on fly
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 26th February 2009, 14:21
  5. Translate QFileDialog
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 7th April 2008, 15:20

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.