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: ...

Get Qt 5 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.