qt5 to qt6 migration
-
Hello ,
I am migrating Qt5 to Qt6. I noticed my custom styles are no longer recognized.
- I am getting followed error
qrc:/main.qml , customesytlename module not installed.
In Qt5 there was an api related to setStylePath its no longer there on Qt6. Its mentioned as deprecated since styles are considered as modules in qt6.
Could you please tell me how to set path for the custom styles in Qt6. I defined them in qmldir file but it didnt help.
Thanks
- I am getting followed error
-
Hi, and welcome!
@raj11157 said in qt5 to qt6 migration:
qrc:/main.qml , customesytlename module not installed.
What is the (case-sensitive) name of your style file? Import it using its name, like you would import any other QML module.
https://doc.qt.io/qt-6/qtquickcontrols-changes-qt6.html says "there is now only one valid, case-sensitive form for style names: "Material", "MyStyle", and so on. That is: the style name must exactly match the name of the QML module. This also applies to file selectors, where previously, all style names were lower case."
-
All my Style files are upper case qml files. They were imported as a shared library to my module.
In qt5 we used "setStylePath" which points to the root directory of qml files.
Now with the qt6 its complains about module not installed.- I have tried to add QmlEngine:addImportPath but it didnt help.
- I have added all qml files in qmldir and defined the module name it also didnt help.
-
@raj11157 said in qt5 to qt6 migration:
All my Style files are upper case qml files.
customesytlename is all lowercase