企业版图表 QtCharts 的使用

要想在qml使用图表
import QtCharts 2.0
同时在初始化的时候是这样启动的

include

include

include "src/interactivecenter.h"

int main(int argc, char *argv[])
{
// Qt Charts uses Qt Graphics View Framework for drawing, therefore QApplication must be used.
QApplication app(argc, argv);
qmlRegisterType("InteractiveCenter", 1, 0, "QuantInteractiveCenter");
QQuickView viewer;
// QObject::connect(viewer.engine(), &QQmlEngine::quit, &viewer, &QWindow::close);
viewer.setSource(QUrl("qrc:/qml/main.qml"));
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
viewer.show();
return app.exec();
}

你可能感兴趣的:(企业版图表 QtCharts 的使用)