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.
- As usual, remove the status bar, menu bar, and tool bar.
- Add Label into
centralWidget
and change its object name tononTransLabel
. Then, change its text toThis is a non-translatable label
and unchecktranslatable
undertext
in Property Editor. - Drag a Push Button just beneath
nonTransLabel
withtransButton
as its object name. Change its text toThis is a translatable button
. - Change Lay out to Lay Out Vertically in MainWindow.
- 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, ...
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.