O'Reilly logo

Qt 5 Blueprints by Symeon Huang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Disambiguating identical texts

If there are identical texts, the default behavior is to treat them as the texts with the same meaning. This could effectively save translators from translating the same texts. Meanwhile, this doesn't hold true all the time. For instance, the word open can be used as a noun or an adjective, which may be different words in other languages. Thankfully, it's possible and easy to disambiguate identical texts in Qt.

Now, let's add a PushButton and openButton between transButton and nonTransLabel. Use Open as its text, and then edit mainwindow.h. Add a new private slot named onOpenButtonClicked(), which is used to handle the event when openButton gets clicked. The relevant source file, mainwindow.cpp, is pasted as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required