I did not run Qt with this environment variable set. So now I understand that the variables in the .pro file are not the same as build/run environment variables.
I want to have all the qmls inside the module to be built into the application/not deploy them separately. After reading your answer I think I should not be using a module for this. (?)
My original problem that made me start to use modules was that I have many projects in a folder, just like the example project I included in my question and I have a folder next to them just like mymodule which contains qmls used by all projects (common qml components I made).
However, when I try to include this folder in example/main.qml, like this:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Dialogs 1.2
//import mymodule 1.0
import "../mymodule"
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Example{
}
}
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Dialogs 1.2
//import mymodule 1.0
import "../mymodule"
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Example{
}
}
To copy to clipboard, switch view to plain text mode
In the code snippet Example is purple, which means the editor can find it in mymodule. But when I build it, it says "../mymodule" is not a directory.
If I copy paste the mymodule folder inside the project folder (to example/mymodule) and import "mymodule" it finds it and runs.
Also if I put import ".." it says ".." is not a directory.
Why can't I import anything above the project's folder?
Bookmarks