File indexing completed on 2024-05-12 04:20:07
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 QT_BEGIN_NAMESPACE 0025 class QLabel; 0026 class QPrinter; 0027 QT_END_NAMESPACE 0028 0029 class MainWindow : public QWidget, private Ui::MainWindow 0030 { 0031 Q_OBJECT 0032 0033 public: 0034 MainWindow( QWidget* parent = nullptr ); 0035 0036 protected: 0037 /** 0038 * Adjusts the two small charts when the window is resized. 0039 */ 0040 /* reimp */ void resizeEvent ( QResizeEvent * ) override; 0041 0042 private Q_SLOTS: 0043 0044 void on_lineTypeCB_currentIndexChanged( const QString & text ); 0045 void on_paintLegendCB_toggled( bool checked ); 0046 void on_paintValuesCB_toggled( bool checked ); 0047 void on_paintMarkersCB_toggled( bool checked ); 0048 void on_markersStyleCB_currentIndexChanged( const QString & text ); 0049 void on_markersWidthSB_valueChanged( int i ); 0050 void on_markersHeightSB_valueChanged( int i); 0051 void on_displayAreasCB_toggled( bool checked ); 0052 void on_transparencySB_valueChanged( int i ); 0053 void on_zoomFactorSB_valueChanged( qreal factor ); 0054 void on_hSBar_valueChanged( int value ); 0055 void on_vSBar_valueChanged( int value ); 0056 void on_savePB_clicked(); 0057 void on_savePDF_clicked(); 0058 void slotPaintRequested(QPrinter *printer); 0059 void on_printButton_clicked(); 0060 private: 0061 void paintMarkers( bool checked, const QSize& printSize ); 0062 0063 private: 0064 KChart::Chart* m_chart; 0065 TableModel m_model; 0066 KChart::DatasetProxyModel* m_datasetProxy; 0067 KChart::LineDiagram* m_lines; 0068 KChart::Legend* m_legend; 0069 QPixmap m_pix1, m_pix2; 0070 QLabel* m_smallChart1; 0071 QLabel* m_smallChart2; 0072 }; 0073 0074 #endif /* MAINWINDOW_H */