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 Quick applications

The procedure of translating a Qt Quick application is similar to a Qt Widgets application. We'll walk through the process with another example application.

Create a new Qt Quick application project and name it Internationalization_QML. The generated main.qml file has already added a qsTr() function for us. The contents may differ slightly in a later version of Qt Creator and (or) Qt Library. However, it should look similar to this one:

import QtQuick 2.3 import QtQuick.Controls 1.2 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") menuBar: MenuBar { Menu { title: qsTr("File") MenuItem { text: qsTr("&Open") onTriggered: console.log("Open action triggered"); } MenuItem { text: qsTr("Exit") ...

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