File indexing completed on 2024-05-12 04:20:15

0001 /**
0002  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #ifndef MAINWINDOW_H
0010 #define MAINWINDOW_H
0011 
0012 #include "ui_mainwindow.h"
0013 #include <TableModel.h>
0014 
0015 #include <QPixmap>
0016 
0017 namespace KChart {
0018     class Chart;
0019     class DatasetProxyModel;
0020     class LineDiagram;
0021     class Legend;
0022 }
0023 
0024 class QLabel;
0025 
0026 class MainWindow : public QWidget, private Ui::MainWindow
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     MainWindow( QWidget* parent = nullptr );
0032     void updateData(QString data);
0033 
0034     protected:
0035         /**
0036          * Adjusts the two small charts when the window is resized.
0037          */
0038         /* reimp */ void resizeEvent ( QResizeEvent * ) override;
0039 
0040 private Q_SLOTS:
0041 
0042     void setLineType( const QString & text );
0043     void setLegendVisible( bool visible );
0044     void setValuesVisible( bool visible );
0045     void setMarkersVisible( bool visible );
0046     void updateMarkers();
0047     void updateMarkersHeight();
0048     void updateMarkersWidth();
0049     void updateAreas( bool visible );
0050     void updateAreasTransparency();
0051     void setZoomFactor( qreal factor );
0052     void setHPos( int value );
0053     void setVPos( int value );
0054     void saveChart();
0055 
0056 private:
0057     void paintMarkers( bool checked, const QSize& printSize );
0058 
0059 private:
0060     KChart::Chart* m_chart;
0061     TableModel m_model;
0062     KChart::DatasetProxyModel* m_datasetProxy;
0063     KChart::LineDiagram* m_lines;
0064     KChart::Legend* m_legend;
0065     QPixmap m_pix1, m_pix2;
0066     QLabel* m_smallChart1;
0067     QLabel* m_smallChart2;
0068 };
0069 
0070 #endif /* MAINWINDOW_H */