mirror of
https://github.com/tnodir/fort
synced 2024-11-15 03:36:07 +00:00
UI: Use QCustomPlot instead of QtCharts.
This commit is contained in:
parent
421501e77a
commit
f08dbc9182
@ -2,7 +2,6 @@
|
||||
"files": {
|
||||
"${TARGET}": {
|
||||
"common": [
|
||||
"${QTPATH}/bin/Qt5Charts.dll",
|
||||
"${QTPATH}/bin/Qt5Core.dll",
|
||||
"${QTPATH}/bin/Qt5Gui.dll",
|
||||
"${QTPATH}/bin/Qt5Qml.dll",
|
||||
|
@ -6,7 +6,7 @@
|
||||
md %TARGET_PATH%
|
||||
cd %TARGET_PATH%
|
||||
del /Q /F qt*.* FortFirewall.exe
|
||||
rd /Q /S imports plugins i18n
|
||||
rd /Q /S i18n imports plugins scripts
|
||||
cd ..
|
||||
|
||||
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
|
||||
|
||||
@ -168,3 +168,5 @@ installer_build {
|
||||
}
|
||||
|
||||
include(db/sqlite/sqlite.pri)
|
||||
|
||||
include(graph/qcustomplot/qcustomplot.pri)
|
||||
|
@ -1,14 +1,8 @@
|
||||
#include "graphwindow.h"
|
||||
|
||||
#include <QGraphicsLayout>
|
||||
#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) :
|
||||
WidgetWindow(parent)
|
||||
@ -26,15 +20,14 @@ GraphWindow::GraphWindow(QWidget *parent) :
|
||||
|
||||
void GraphWindow::setupUi()
|
||||
{
|
||||
QChart *chart = new QChart();
|
||||
chart->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
chart->setBackgroundRoundness(0);
|
||||
QCustomPlot *plot = new QCustomPlot(this);
|
||||
plot->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QChartView *chartView = new QChartView(chart);
|
||||
chartView->setRenderHint(QPainter::Antialiasing);
|
||||
QCPGraph *graph = plot->addGraph();
|
||||
graph->setPen(QColor(250, 120, 0));
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout();
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->addWidget(chartView);
|
||||
mainLayout->addWidget(plot);
|
||||
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