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

Translating Qt Widgets applications

First, let's create a new Qt Widget project, whose name is Internationalization. Then, edit mainwindow.ui in the Design mode.

  1. As usual, remove the status bar, menu bar, and tool bar.
  2. Add Label into centralWidget and change its object name to nonTransLabel. Then, change its text to This is a non-translatable label and uncheck translatable under text in Property Editor.
  3. Drag a Push Button just beneath nonTransLabel with transButton as its object name. Change its text to This is a translatable button.
  4. Change Lay out to Lay Out Vertically in MainWindow.
  5. Resize the frame to a comfortable size.

Go back to editing the Internationalization.pro project file in the Edit mode. Add a line indicating the translation source file, ...

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