Skip to content

Commit 9fbc4f4

Browse files
Project update
Code reformat Remove dead code Update QCP to 2.1.1 Remove use of deprecated methods
1 parent 46170bc commit 9fbc4f4

10 files changed

+15278
-9060
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
qmlplot.pro.user

Diff for: README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# qmlplot
1+
# QCustomPlot in QML
22

3-
This is a wrapper to QCustomPlot to render by QtQuick2.
4-
Implemented [solution from QCustomPlot forum](http://www.qcustomplot.com/index.php/support/forum/172).
3+
Original source project: <https://github.com/mosolovsa/qmlplot>. Here some changes applied (like code reformat, compile errors and warnings fixes and QCP library version update).

Diff for: main.cpp

+9-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
#include <QtPrintSupport/QPrinter>
2-
//#include <QGuiApplication>
3-
#include<QApplication>
4-
#include <QQmlApplicationEngine>
5-
61
#include "qmlplot.h"
2+
#include <QApplication>
3+
#include <QQmlApplicationEngine>
4+
#include <QtPrintSupport/QPrinter>
75

8-
int main(int argc, char *argv[])
9-
{
10-
QApplication a(argc, argv);
11-
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
12-
// QGuiApplication app(argc, argv);
6+
int main(int argc, char *argv[]) {
7+
QApplication a(argc, argv);
138

14-
qmlRegisterType<CustomPlotItem>("CustomPlot", 1, 0, "CustomPlotItem");
9+
qmlRegisterType<CustomPlotItem>("CustomPlot", 1, 0, "CustomPlotItem");
1510

16-
QQmlApplicationEngine engine;
17-
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
11+
QQmlApplicationEngine engine;
12+
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
1813

19-
return a.exec();
14+
return a.exec();
2015
}

Diff for: main.qml

+3-10
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,18 @@ ApplicationWindow {
88
height: 480
99
title: qsTr("Hello QCustomPlot in QML")
1010

11-
// Item {
12-
// id: mainView
13-
// anchors.fill: parent
14-
// PlotView {
15-
// }
16-
// }
1711
SwipeView {
1812
id: swipeView
1913
anchors.fill: parent
2014
currentIndex: tabBar.currentIndex
2115
interactive: false
2216

23-
PlotView {
24-
}
17+
PlotView {}
2518

2619
Page {
2720
Label {
28-
text: qsTr("This is implementation of http://www.qcustomplot.com/index.php/support/forum/172\n" +
29-
"Adding random data on 500 ms tick to plot")
21+
text: qsTr("This is implementation of http://www.qcustomplot.com/index.php/support/forum/172\n"
22+
+ "Adding random data on 500 ms tick to plot")
3023
anchors.centerIn: parent
3124
}
3225
}

0 commit comments

Comments
 (0)