PDA

View Full Version : The difference between tr and translate



rezas1000
15th August 2014, 11:40
Hi
What is the difference between tr and translate in the code?
thanks

anda_skoa
15th August 2014, 13:29
http://qt-project.org/doc/qt-5/qcoreapplication.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,
_