File indexing completed on 2024-05-19 15:26:53

0001 /**
0002  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB.  All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * This program is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU General Public License as
0008  * published by the Free Software Foundation; either version 2 of
0009  * the License, or (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
0018  */
0019 
0020 #ifndef MAINWINDOW_H
0021 #define MAINWINDOW_H
0022 
0023 #include "ui_mainwindow.h"
0024 #include <TableModel.h>
0025 
0026 #include <QPixmap>
0027 
0028 namespace KChart {
0029     class Chart;
0030     class DatasetProxyModel;
0031     class LineDiagram;
0032     class Legend;
0033 }
0034 
0035 QT_BEGIN_NAMESPACE
0036 class QLabel;
0037 class QPrinter;
0038 QT_END_NAMESPACE
0039 
0040 class MainWindow : public QWidget, private Ui::MainWindow
0041 {
0042     Q_OBJECT
0043 
0044 public:
0045     MainWindow( QWidget* parent = nullptr );
0046 
0047     protected:
0048     /**
0049      * Adjusts the two small charts when the window is resized.
0050      */
0051     /* reimp */ void resizeEvent ( QResizeEvent * ) override;
0052 
0053 private Q_SLOTS:
0054 
0055     void on_lineTypeCB_currentIndexChanged( const QString & text );
0056     void on_paintLegendCB_toggled( bool checked );
0057     void on_paintValuesCB_toggled( bool checked );
0058     void on_paintMarkersCB_toggled( bool checked );
0059     void on_markersStyleCB_currentIndexChanged( const QString & text );
0060     void on_markersWidthSB_valueChanged( int i );
0061     void on_markersHeightSB_valueChanged( int i);
0062     void on_displayAreasCB_toggled( bool checked );
0063     void on_transparencySB_valueChanged( int i );
0064     void on_zoomFactorSB_valueChanged( qreal factor );
0065     void on_hSBar_valueChanged( int value );
0066     void on_vSBar_valueChanged( int value );
0067     void on_savePB_clicked();
0068     void on_savePDF_clicked();
0069     void slotPaintRequested(QPrinter *printer);
0070     void on_printButton_clicked();
0071 private:
0072     void paintMarkers( bool checked, const QSize& printSize );
0073 
0074 private:
0075     KChart::Chart* m_chart;
0076     TableModel m_model;
0077     KChart::DatasetProxyModel* m_datasetProxy;
0078     KChart::LineDiagram* m_lines;
0079     KChart::Legend* m_legend;
0080     QPixmap m_pix1, m_pix2;
0081     QLabel* m_smallChart1;
0082     QLabel* m_smallChart2;
0083 };
0084 
0085 #endif /* MAINWINDOW_H */