Qt 6.11 is out! See what's new in the release
blog
Building Qt Quick project in Visual Studio
-
I'm trying to build Qt QML project in Visual Studio 2019 using Qt Tools for Visual stuido and have one problem.
In .pro file I have these lines:QML_IMPORT_NAME = PRJ1 QML_IMPORT_MAJOR_VERSION = 1and in main.qml:
import PRJ1These line are needed to import custom QML types.
I converted .pro to .vcxproj via "Qt Tools for Visual stuido " and the converter didn't add "PRJ1" to vcxproj. When i start the program it crahshes with error that PRJ1 is not defined. If I remove "import PRJ1" it works but without custom types. How should QML_IMPORT_NAME and QML_IMPORT_MAJOR_VERSION be defined in visual studio project? -
You should consider using
qmlRegisterType()function. Check the example here.
Also, you can try to edit something in the .vcproj settings, as it has almost all of the .pro settings:
