SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
ProgressWindow.h
Go to the documentation of this file.
1#pragma once
2
3#include <QWidget>
4#include <QDialog>
5#include "ui_ProgressWindow.h"
6#include <qchartview.h>
7#include <qchart.h>
8#include <QtCharts/QLineSeries>
9#include <QtCharts/QValueAxis>
10#include "QtCharts/QAreaSeries"
11#include "progressreporter.h"
12
13#ifndef Qt6
14using namespace QtCharts;
15#endif
16
18
20{
21 QChart* chart;
22 QChartView *chartView;
23 QLineSeries* series;
24 QAreaSeries* areaseries;
25 QValueAxis *yaxis;
26 QValueAxis *xaxis;
27};
28
36class ProgressWindow : public QDialog, public ProgressReporter
37{
38 Q_OBJECT
39
40public:
41 ProgressWindow(QWidget *parent = Q_NULLPTR, int number_of_panels=1, bool extra_label_and_progressbar = false);
43 void AppendPoint(const double& x, const double& y, int chart=0) override;
44 void SetProgress(const double& prog) override;
45 void SetProgress2(const double& prog) override;
46 void SetLabel(const QString& label) override;
47 void SetYRange(const double &y0, const double &y1, int chart=0) override;
48 void SetXRange(const double &x0, const double &x1, int chart=0) override;
49 void SetTitle(const QString &title, int chart=0) override;
50 void SetXAxisTitle(const QString &title, int chart=0) override;
51 void SetYAxisTitle(const QString &title, int chart=0) override;
52 void ClearGraph(int chart=0) override;
53 void SetChartTitle(int i, const QString &title) override
54 {
55 if (ChartItems.size()>i)
56 { charttitles[i]=title;
57 ChartItems[i].chart->setTitle(title);
58 }
59 }
60
62 void Start() override { show(); }
63
65 void Finish() override { close(); }
66private:
67 Ui::ProgressWindow ui;
68 QVector<ChartCollection> ChartItems;
69 QVector<QString> charttitles;
70};
progress_window_mode
Abstract sink for progress information produced by a running analysis.
Graphical ProgressReporter that draws progress as charts in a dialog.
void SetProgress2(const double &prog) override
Sets the secondary progress fraction, where one is displayed.
void SetTitle(const QString &title, int chart=0) override
Sets the title of a chart.
void SetYRange(const double &y0, const double &y1, int chart=0) override
Sets the vertical range of a chart.
void SetXAxisTitle(const QString &title, int chart=0) override
Sets the horizontal axis title of a chart.
void SetChartTitle(int i, const QString &title) override
Sets the title of chart i.
void SetXRange(const double &x0, const double &x1, int chart=0) override
Sets the horizontal range of a chart.
Ui::ProgressWindow ui
void ClearGraph(int chart=0) override
Discards the points accumulated in a chart.
QVector< ChartCollection > ChartItems
void SetYAxisTitle(const QString &title, int chart=0) override
Sets the vertical axis title of a chart.
void Finish() override
Closes the dialog. Named Finish() because QWidget::close() is not virtual.
void SetProgress(const double &prog) override
Sets the primary progress fraction.
void SetLabel(const QString &label) override
Sets the free-text status label.
void Start() override
Shows the dialog. Named Start() because QWidget::show() is not virtual.
QVector< QString > charttitles
void AppendPoint(const double &x, const double &y, int chart=0) override
Adds a point to one of the progress charts.
QValueAxis * xaxis
QAreaSeries * areaseries
QValueAxis * yaxis
QLineSeries * series
QChartView * chartView