mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:46:03 +00:00
UI: Use QCustomPlot instead of QtCharts.
This commit is contained in:
parent
421501e77a
commit
f08dbc9182
@ -2,7 +2,6 @@
|
|||||||
"files": {
|
"files": {
|
||||||
"${TARGET}": {
|
"${TARGET}": {
|
||||||
"common": [
|
"common": [
|
||||||
"${QTPATH}/bin/Qt5Charts.dll",
|
|
||||||
"${QTPATH}/bin/Qt5Core.dll",
|
"${QTPATH}/bin/Qt5Core.dll",
|
||||||
"${QTPATH}/bin/Qt5Gui.dll",
|
"${QTPATH}/bin/Qt5Gui.dll",
|
||||||
"${QTPATH}/bin/Qt5Qml.dll",
|
"${QTPATH}/bin/Qt5Qml.dll",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
md %TARGET_PATH%
|
md %TARGET_PATH%
|
||||||
cd %TARGET_PATH%
|
cd %TARGET_PATH%
|
||||||
del /Q /F qt*.* FortFirewall.exe
|
del /Q /F qt*.* FortFirewall.exe
|
||||||
rd /Q /S imports plugins i18n
|
rd /Q /S i18n imports plugins scripts
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
powershell.exe -executionpolicy remotesigned -file setup-deployment.ps1 %TARGET_PATH% %*
|
powershell.exe -executionpolicy remotesigned -file setup-deployment.ps1 %TARGET_PATH% %*
|
||||||
|
30214
src/3rdparty/qcustomplot/qcustomplot.cpp
vendored
Normal file
30214
src/3rdparty/qcustomplot/qcustomplot.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6673
src/3rdparty/qcustomplot/qcustomplot.h
vendored
Normal file
6673
src/3rdparty/qcustomplot/qcustomplot.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
QT += charts core gui qml widgets
|
QT += core gui qml widgets
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
@ -168,3 +168,5 @@ installer_build {
|
|||||||
}
|
}
|
||||||
|
|
||||||
include(db/sqlite/sqlite.pri)
|
include(db/sqlite/sqlite.pri)
|
||||||
|
|
||||||
|
include(graph/qcustomplot/qcustomplot.pri)
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
#include "graphwindow.h"
|
#include "graphwindow.h"
|
||||||
|
|
||||||
#include <QGraphicsLayout>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QtCharts/QBarCategoryAxis>
|
|
||||||
#include <QtCharts/QBarSeries>
|
|
||||||
#include <QtCharts/QBarSet>
|
|
||||||
#include <QtCharts/QChartView>
|
|
||||||
#include <QtCharts/QLegend>
|
|
||||||
|
|
||||||
QT_CHARTS_USE_NAMESPACE
|
#include "qcustomplot.h"
|
||||||
|
|
||||||
GraphWindow::GraphWindow(QWidget *parent) :
|
GraphWindow::GraphWindow(QWidget *parent) :
|
||||||
WidgetWindow(parent)
|
WidgetWindow(parent)
|
||||||
@ -26,15 +20,14 @@ GraphWindow::GraphWindow(QWidget *parent) :
|
|||||||
|
|
||||||
void GraphWindow::setupUi()
|
void GraphWindow::setupUi()
|
||||||
{
|
{
|
||||||
QChart *chart = new QChart();
|
QCustomPlot *plot = new QCustomPlot(this);
|
||||||
chart->layout()->setContentsMargins(0, 0, 0, 0);
|
plot->setContentsMargins(0, 0, 0, 0);
|
||||||
chart->setBackgroundRoundness(0);
|
|
||||||
|
|
||||||
QChartView *chartView = new QChartView(chart);
|
QCPGraph *graph = plot->addGraph();
|
||||||
chartView->setRenderHint(QPainter::Antialiasing);
|
graph->setPen(QColor(250, 120, 0));
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout();
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->setMargin(0);
|
mainLayout->setMargin(0);
|
||||||
mainLayout->addWidget(chartView);
|
mainLayout->addWidget(plot);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
}
|
}
|
||||||
|
12
src/ui/graph/qcustomplot/qcustomplot.pri
Normal file
12
src/ui/graph/qcustomplot/qcustomplot.pri
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
DEFINES += \
|
||||||
|
QCUSTOMPLOT_USE_OPENGL
|
||||||
|
|
||||||
|
QCUSTOMPLOT_DIR = $$PWD/../../../3rdparty/qcustomplot
|
||||||
|
INCLUDEPATH += $$QCUSTOMPLOT_DIR
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
$$QCUSTOMPLOT_DIR/qcustomplot.cpp
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
$$QCUSTOMPLOT_DIR/qcustomplot.h
|
Loading…
Reference in New Issue
Block a user