##// END OF EJS Templates
Add qmlplugin support for integrated build
Michal Klocek -
r255:ef94f64ce15a
parent child
Show More
@@ -0,0 +1,17
1 import QtQuick 1.0
2
3 Item {
4 id: container
5 width: 400
6 height: 500
7 Component.onCompleted: {
8 var co = Qt.createComponent("main.qml")
9 if (co.status == Component.Ready) {
10 var o = co.createObject(container)
11 } else {
12 console.log(co.errorString())
13 console.log("QtCommercial.Chart 1.1 not available")
14 console.log("Please use correct QML_IMPORT_PATH export")
15 }
16 }
17 } No newline at end of file
@@ -0,0 +1,6
1 <RCC>
2 <qresource prefix="/">
3 <file>qml/qmlchart/loader.qml</file>
4 <file>qml/qmlchart/main.qml</file>
5 </qresource>
6 </RCC>
@@ -5,6 +5,7 CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private
5 CHART_BUILD_LIB_DIR = $$PWD/lib
5 CHART_BUILD_LIB_DIR = $$PWD/lib
6 CHART_BUILD_DIR = $$PWD/build
6 CHART_BUILD_DIR = $$PWD/build
7 CHART_BUILD_BIN_DIR = $$PWD/bin
7 CHART_BUILD_BIN_DIR = $$PWD/bin
8 CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR/QtCommercial/Chart
8
9
9 # hack to fix windows builds
10 # hack to fix windows builds
10 win32:{
11 win32:{
@@ -13,6 +14,7 win32:{
13 CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
14 CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
14 CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
15 CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
15 CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
16 CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
17 CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\")
16 }
18 }
17
19
18 mac: {
20 mac: {
@@ -7,7 +7,7
7
7
8 TEMPLATE = lib
8 TEMPLATE = lib
9 TARGET = qtcommercialchartqml
9 TARGET = qtcommercialchartqml
10
10 DESTDIR = $$CHART_BUILD_PLUGIN_DIR
11 CONFIG += qt plugin
11 CONFIG += qt plugin
12 QT += declarative
12 QT += declarative
13
13
@@ -16,10 +16,10 contains(QT_MAJOR_VERSION, 5) {
16 DEFINES += QTQUICK2
16 DEFINES += QTQUICK2
17 }
17 }
18
18
19 OBJECTS_DIR = $$CHART_BUILD_DIR/lib
19 OBJECTS_DIR = $$CHART_BUILD_DIR/plugin
20 MOC_DIR = $$CHART_BUILD_DIR/lib
20 MOC_DIR = $$CHART_BUILD_DIR/plugin
21 UI_DIR = $$CHART_BUILD_DIR/lib
21 UI_DIR = $$CHART_BUILD_DIR/plugin
22 RCC_DIR = $$CHART_BUILD_DIR/lib
22 RCC_DIR = $$CHART_BUILD_DIR/plugin
23
23
24 SOURCES += \
24 SOURCES += \
25 plugin.cpp \
25 plugin.cpp \
@@ -37,6 +37,8 HEADERS += \
37 declarativepieseries.h \
37 declarativepieseries.h \
38 declarativelineseries.h
38 declarativelineseries.h
39
39
40 QMAKE_POST_LINK = $$QMAKE_COPY qmldir $$CHART_BUILD_PLUGIN_DIR
41
40 TARGETPATH = QtCommercial/Chart
42 TARGETPATH = QtCommercial/Chart
41 target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
43 target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
42 qmldir.files += $$PWD/qmldir
44 qmldir.files += $$PWD/qmldir
@@ -8,7 +8,7 Q_DECL_EXPORT int main(int argc, char *argv[])
8 QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
8 QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
9
9
10 viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
10 viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
11 viewer->setMainQmlFile(QLatin1String("qml/qmlchart/main.qml"));
11 viewer->setSource(QUrl("qrc:/qml/qmlchart/loader.qml"));
12 viewer->showExpanded();
12 viewer->showExpanded();
13
13
14 return app->exec();
14 return app->exec();
@@ -2,8 +2,8 import QtQuick 1.0
2 import QtCommercial.Chart 1.0
2 import QtCommercial.Chart 1.0
3
3
4 Rectangle {
4 Rectangle {
5 width: 360
5 width: parent.width
6 height: 360
6 height: parent.height
7
7
8 // Another option for QML data api:
8 // Another option for QML data api:
9 // ListModel {
9 // ListModel {
@@ -1,18 +1,21
1 !include( ../../common.pri ) {
1 !include( ../../common.pri ) {
2 error( "Couldn't find the common.pri file!" )
2 error( "Couldn't find the common.pri file!" )
3 }
3 }
4 !include( ../../integrated.pri ) {
4
5 error( "Couldn't find the integrated.pri file !")
5 DESTDIR = $$CHART_BUILD_BIN_DIR
6 }
6
7 OBJECTS_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
8 MOC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
9 UI_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
10 RCC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
7
11
8 integrated_build: {
12 integrated_build:{
9 # cannot use integrated build for now; we would need the qml files copied to
13 message(Please export QML_IMPORT_PATH=$$CHART_BUILD_LIB_DIR)
10 # charts/bin folder also to make this work. And even in that case I'm not sure if
11 # the chart qml plugin can be found or if it needs to be installed to the qt's plugin
12 # folder always.
13 warning("TODO: Charts qml test app does not work with integrated builds")
14 }
14 }
15
15
16 RESOURCES += \
17 resources.qrc
18
16 # Add more folders to ship with the application, here
19 # Add more folders to ship with the application, here
17 folder_01.source = qml/qmlchart
20 folder_01.source = qml/qmlchart
18 folder_01.target = qml
21 folder_01.target = qml
General Comments 0
You need to be logged in to leave comments. Login now