Using tr ("...") in Qt

0

What is the difference when creating a QString of the Qt 5 framework when using tr("...") or not, for example:

QString("texto");
QString(tr("texto"));

What is the tr() good for?

    
asked by nullptr 10.09.2017 в 16:16
source

1 answer

1

tr() is a function of Qt that gives you the multilanguage support of your application. All text that will be visible to the user should be displayed as QString(tr("texto")); . In this way, with the help of the QtLinguist library, it is very easy to create multilanguage applications by creating the translation files. Here I leave a link to a tutorial / example of what I'm telling you.

I hope it serves you. Greetings

    
answered by 10.09.2017 / 21:47
source