mirror of https://github.com/qt/qtcharts.git
Add qmlplugin support for integrated build
This commit is contained in:
parent
0045e32956
commit
ef94f64ce1
|
@ -5,6 +5,7 @@ CHART_BUILD_PRIVATE_HEADER_DIR = $$CHART_BUILD_PUBLIC_HEADER_DIR/private
|
|||
CHART_BUILD_LIB_DIR = $$PWD/lib
|
||||
CHART_BUILD_DIR = $$PWD/build
|
||||
CHART_BUILD_BIN_DIR = $$PWD/bin
|
||||
CHART_BUILD_PLUGIN_DIR = $$CHART_BUILD_LIB_DIR/QtCommercial/Chart
|
||||
|
||||
# hack to fix windows builds
|
||||
win32:{
|
||||
|
@ -13,6 +14,7 @@ win32:{
|
|||
CHART_BUILD_LIB_DIR = $$replace(CHART_BUILD_LIB_DIR, "/","\\")
|
||||
CHART_BUILD_BUILD_DIR = $$replace(CHART_BUILD_BUILD_DIR, "/","\\")
|
||||
CHART_BUILD_BIN_DIR = $$replace(CHART_BUILD_BIN_DIR, "/","\\")
|
||||
CHART_BUILD_PLUGIN_DIR = $$replace(CHART_BUILD_PLUGIN_DIR, "/","\\")
|
||||
}
|
||||
|
||||
mac: {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
TEMPLATE = lib
|
||||
TARGET = qtcommercialchartqml
|
||||
|
||||
DESTDIR = $$CHART_BUILD_PLUGIN_DIR
|
||||
CONFIG += qt plugin
|
||||
QT += declarative
|
||||
|
||||
|
@ -16,10 +16,10 @@ contains(QT_MAJOR_VERSION, 5) {
|
|||
DEFINES += QTQUICK2
|
||||
}
|
||||
|
||||
OBJECTS_DIR = $$CHART_BUILD_DIR/lib
|
||||
MOC_DIR = $$CHART_BUILD_DIR/lib
|
||||
UI_DIR = $$CHART_BUILD_DIR/lib
|
||||
RCC_DIR = $$CHART_BUILD_DIR/lib
|
||||
OBJECTS_DIR = $$CHART_BUILD_DIR/plugin
|
||||
MOC_DIR = $$CHART_BUILD_DIR/plugin
|
||||
UI_DIR = $$CHART_BUILD_DIR/plugin
|
||||
RCC_DIR = $$CHART_BUILD_DIR/plugin
|
||||
|
||||
SOURCES += \
|
||||
plugin.cpp \
|
||||
|
@ -37,6 +37,8 @@ HEADERS += \
|
|||
declarativepieseries.h \
|
||||
declarativelineseries.h
|
||||
|
||||
QMAKE_POST_LINK = $$QMAKE_COPY qmldir $$CHART_BUILD_PLUGIN_DIR
|
||||
|
||||
TARGETPATH = QtCommercial/Chart
|
||||
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
|
||||
qmldir.files += $$PWD/qmldir
|
||||
|
|
|
@ -8,7 +8,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
|||
QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
|
||||
|
||||
viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
|
||||
viewer->setMainQmlFile(QLatin1String("qml/qmlchart/main.qml"));
|
||||
viewer->setSource(QUrl("qrc:/qml/qmlchart/loader.qml"));
|
||||
viewer->showExpanded();
|
||||
|
||||
return app->exec();
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
width: 400
|
||||
height: 500
|
||||
Component.onCompleted: {
|
||||
var co = Qt.createComponent("main.qml")
|
||||
if (co.status == Component.Ready) {
|
||||
var o = co.createObject(container)
|
||||
} else {
|
||||
console.log(co.errorString())
|
||||
console.log("QtCommercial.Chart 1.1 not available")
|
||||
console.log("Please use correct QML_IMPORT_PATH export")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@ import QtQuick 1.0
|
|||
import QtCommercial.Chart 1.0
|
||||
|
||||
Rectangle {
|
||||
width: 360
|
||||
height: 360
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
// Another option for QML data api:
|
||||
// ListModel {
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
!include( ../../common.pri ) {
|
||||
error( "Couldn't find the common.pri file!" )
|
||||
}
|
||||
!include( ../../integrated.pri ) {
|
||||
error( "Couldn't find the integrated.pri file !")
|
||||
|
||||
DESTDIR = $$CHART_BUILD_BIN_DIR
|
||||
|
||||
OBJECTS_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
|
||||
MOC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
|
||||
UI_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
|
||||
RCC_DIR = $$CHART_BUILD_DIR/bin/$$TARGET
|
||||
|
||||
integrated_build:{
|
||||
message(Please export QML_IMPORT_PATH=$$CHART_BUILD_LIB_DIR)
|
||||
}
|
||||
|
||||
integrated_build: {
|
||||
# cannot use integrated build for now; we would need the qml files copied to
|
||||
# charts/bin folder also to make this work. And even in that case I'm not sure if
|
||||
# the chart qml plugin can be found or if it needs to be installed to the qt's plugin
|
||||
# folder always.
|
||||
warning("TODO: Charts qml test app does not work with integrated builds")
|
||||
}
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
|
||||
# Add more folders to ship with the application, here
|
||||
folder_01.source = qml/qmlchart
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>qml/qmlchart/loader.qml</file>
|
||||
<file>qml/qmlchart/main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in New Issue