Unsolved QtCreator Designer how can I see custom object in QML Types?
-
I'm pretty new to QtCreator, my issue is that I'm not able to see QML Custom Components.
For example if you import QtQuick.Controls 1.5 you see under QML types: - Qt Quick - Controls.
So far I have created my personal set of components, here is the folder structure:the components qmldir is done in that way:
# qmldir module components Header 1.0 Header.qml Footer 1.0 Footer.qml CentralPage 1.0 CentralPage.qml GenericButton 1.0 GenericButton.qml ProgressBarCustom 1.0 ProgressBarCustom.qml
than for example in the LandingPageFrom.ui.qml
import QtQuick 2.6 import QtQuick.Controls 1.5 import QtQuick.Layouts 1.3 import components 1.0 as Components Components.CentralPage { pageName: "landingPage" id: landingPage width: 800 height: 1056 property alias aButton: aButton Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter }
And is compiling and running fine but inside the Designer nothing is showing as aspected, I only see .qml that are in the same directory but not the ones in components directory:
this is what I have done in the .pro and in the main.cpp
QML_IMPORT_PATH += $$PWD/resources/common/ui QML_DESIGNER_IMPORT_PATH += resources/common/ui
main.cpp
QQmlApplicationEngine engine; engine.addImportPath("qrc:///ui"); engine.load(QUrl("qrc:///ui/main.qml"));
What is strange is that only the designer is not able to see the components, but the QML code is able, what I'm missing here?
Thanks -
QML_IMPORT_PATH += $$PWD/resources/common/ui
QML_DESIGNER_IMPORT_PATH += resources/common/uiOne is an absolute path, the other a relative path. Maybe that's the essential difference.
-Michael.
-
Tried but this have not fixed it