@@ -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 | 5 | CHART_BUILD_LIB_DIR = $$PWD/lib |
|
6 | 6 | CHART_BUILD_DIR = $$PWD/build |
|
7 | 7 | CHART_BUILD_BIN_DIR = $$PWD/bin |
|
8 | CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR/QtCommercial/Chart | |
|
8 | 9 | |
|
9 | 10 | # hack to fix windows builds |
|
10 | 11 | win32:{ |
@@ -13,6 +14,7 win32:{ | |||
|
13 | 14 | CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\") |
|
14 | 15 | CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\") |
|
15 | 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 | 20 | mac: { |
@@ -7,7 +7,7 | |||
|
7 | 7 | |
|
8 | 8 | TEMPLATE = lib |
|
9 | 9 | TARGET = qtcommercialchartqml |
|
10 | ||
|
10 | DESTDIR = $$CHART_BUILD_PLUGIN_DIR | |
|
11 | 11 | CONFIG += qt plugin |
|
12 | 12 | QT += declarative |
|
13 | 13 | |
@@ -16,10 +16,10 contains(QT_MAJOR_VERSION, 5) { | |||
|
16 | 16 | DEFINES += QTQUICK2 |
|
17 | 17 | } |
|
18 | 18 | |
|
19 |
OBJECTS_DIR = $$CHART_BUILD_DIR/ |
|
|
20 |
MOC_DIR = $$CHART_BUILD_DIR/ |
|
|
21 |
UI_DIR = $$CHART_BUILD_DIR/ |
|
|
22 |
RCC_DIR = $$CHART_BUILD_DIR/ |
|
|
19 | OBJECTS_DIR = $$CHART_BUILD_DIR/plugin | |
|
20 | MOC_DIR = $$CHART_BUILD_DIR/plugin | |
|
21 | UI_DIR = $$CHART_BUILD_DIR/plugin | |
|
22 | RCC_DIR = $$CHART_BUILD_DIR/plugin | |
|
23 | 23 | |
|
24 | 24 | SOURCES += \ |
|
25 | 25 | plugin.cpp \ |
@@ -37,6 +37,8 HEADERS += \ | |||
|
37 | 37 | declarativepieseries.h \ |
|
38 | 38 | declarativelineseries.h |
|
39 | 39 | |
|
40 | QMAKE_POST_LINK = $$QMAKE_COPY qmldir $$CHART_BUILD_PLUGIN_DIR | |
|
41 | ||
|
40 | 42 | TARGETPATH = QtCommercial/Chart |
|
41 | 43 | target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH |
|
42 | 44 | qmldir.files += $$PWD/qmldir |
@@ -8,7 +8,7 Q_DECL_EXPORT int main(int argc, char *argv[]) | |||
|
8 | 8 | QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create()); |
|
9 | 9 | |
|
10 | 10 | viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); |
|
11 |
viewer->set |
|
|
11 | viewer->setSource(QUrl("qrc:/qml/qmlchart/loader.qml")); | |
|
12 | 12 | viewer->showExpanded(); |
|
13 | 13 | |
|
14 | 14 | return app->exec(); |
@@ -2,8 +2,8 import QtQuick 1.0 | |||
|
2 | 2 | import QtCommercial.Chart 1.0 |
|
3 | 3 | |
|
4 | 4 | Rectangle { |
|
5 | width: 360 | |
|
6 |
height: |
|
|
5 | width: parent.width | |
|
6 | height: parent.height | |
|
7 | 7 | |
|
8 | 8 | // Another option for QML data api: |
|
9 | 9 | // ListModel { |
@@ -1,18 +1,21 | |||
|
1 | 1 | !include( ../../common.pri ) { |
|
2 | 2 | error( "Couldn't find the common.pri file!" ) |
|
3 | 3 | } |
|
4 | !include( ../../integrated.pri ) { | |
|
5 | error( "Couldn't find the integrated.pri file !") | |
|
6 | } | |
|
7 | 4 | |
|
8 | integrated_build: { | |
|
9 | # cannot use integrated build for now; we would need the qml files copied to | |
|
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") | |
|
5 | DESTDIR = $$CHART_BUILD_BIN_DIR | |
|
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 | |
|
11 | ||
|
12 | integrated_build:{ | |
|
13 | message(Please export QML_IMPORT_PATH=$$CHART_BUILD_LIB_DIR) | |
|
14 | 14 | } |
|
15 | 15 | |
|
16 | RESOURCES += \ | |
|
17 | resources.qrc | |
|
18 | ||
|
16 | 19 | # Add more folders to ship with the application, here |
|
17 | 20 | folder_01.source = qml/qmlchart |
|
18 | 21 | folder_01.target = qml |
General Comments 0
You need to be logged in to leave comments.
Login now