QmlProject: Implement basic support for QmlFileSelector

This patch adds support for QmlFileSelector for
QmlProject and Qt Quick Designer.

Task-number: QDS-590
Change-Id: I0cc043d3ec9578008ec879b36fe834b70fb8c5ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Thomas Hartmann
2019-04-08 17:02:20 +02:00
parent ba73d97852
commit f8202239d6
9 changed files with 54 additions and 0 deletions
@@ -25,6 +25,7 @@
#include "qt5nodeinstanceserver.h"
#include <QQmlFileSelector>
#include <QQuickItem>
#include <QQuickView>
@@ -58,6 +59,12 @@ void Qt5NodeInstanceServer::initializeView()
m_quickView = new QQuickView;
DesignerSupport::createOpenGLContext(m_quickView.data());
if (qEnvironmentVariableIsSet("QML_FILE_SELECTORS")) {
QQmlFileSelector *fileSelector = new QQmlFileSelector(engine(), engine());
QStringList customSelectors = QString::fromUtf8(qgetenv("QML_FILE_SELECTORS")).split(",");
fileSelector->setExtraSelectors(customSelectors);
}
}
QQmlView *Qt5NodeInstanceServer::declarativeView() const