I want to make translations in my toolbar. The toolbar is a listmodel:
import QtQuick 1.1 ListModel { id:tBar ListElement { buttonText: QT_TR_NOOP("Cars In Speed Function") bottomText: "" event: "carsInSpdFn" buttonLevel: "0" buttonBurst: false icon: "qrc:/icons/histogram_128x128_w.png" color: "#369c3b" active: true permissionLevel: 0 } ListElement { buttonText: QT_TR_NOOP("Clear all logs") bottomText: "" event: "cleraAllLogs" buttonLevel: "0" buttonBurst: false icon: "qrc:/icons/trash_128x128_w.png" color: "steelblue" active: true permissionLevel: 3 }
The list is called in the file in the property value. Main file:
/.. DynamicApp{ id: statistics objectName: "Statistics" toolbarModel: ToolbarModel{} title: qsTr("Statistics management") icon: "qrc:/icons/statistics_128x128_w.png" ../
DynamicApp is a qml file that indicates the application window. A toolbarModel is defined, which is a "property variant". DynamicApp:
/.. Rectangle { id: app width: main.width height: main.height color: layout_id.bgColor opacity: 0 property variant parameter; property bool useToolbar: true property bool useTopbar: true property bool activeApp: false property variant toolbarModel property string title: "" property string icon: "" ../
I know how to translate model lists using qsTr or qsTranslate, but I donβt know how to put it in a property variant, because there is a call to the entire toolbarModel file. Can you explain to me how to translate this list into my application?
source share