Building Qt Quick project in Visual Studio
-
wrote on 16 Jan 2021, 21:17 last edited by
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 = 1
and in main.qml:
import PRJ1
These 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? -
wrote on 11 Feb 2021, 14:23 last edited by
@Dmitry87 said in Building Qt Quick project in Visual Studio:
I have the same problem. Where I have to config QML_IMPORT_NAME etc. in Visual Studio ?
-
wrote on 28 Feb 2021, 15:20 last edited by
I had the same problem when using VS2015.
I tried qt example project openglunderqml did the same error. -
wrote on 28 Feb 2021, 15:54 last edited by Krakenus00
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: