Solved How could I apply dynamic text translation on QQuickItem ?
-
Qt5.10 introduce a new way to do dynamic translation as this post mentioned, but that solution need QQmlEngine, could I translate the text like that if load the qml by QQuickItem?
Edit : Not QQuickItem by QQuickWidget
-
@tham said in How could I apply dynamic text translation on QQuickItem ?:
if load the qml by QQuickItem?
How do you load QML via QQuickItem? Please share some code.
-
I use QQuickWidget to load the qml, after that use rootObject to access QQuickItem.
ui->quickWidget->setSource(QStringLiteral("qrc:/SomeSortOfFile.qml")); root_ = ui->quickWidget->rootObject();
-
Well, then your QQmlEngine is in your QQuickWidget. See the docs.