1 /** 2 * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 3 * 4 * This file is part of the KD Chart library. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <https://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef MAINWINDOW_H 21 #define MAINWINDOW_H 22 23 #include <QDialog> 24 #include <QMap> 25 26 #include "ui_mainwindow.h" 27 #include "derivedaddlegenddialog.h" 28 #include <TableModel.h> 29 30 namespace KChart { 31 class Chart; 32 class LineDiagram; 33 } 34 35 class MainWindow : public QWidget, private Ui::MainWindow 36 { 37 Q_OBJECT 38 39 public: 40 MainWindow( QWidget* parent = nullptr ); 41 42 private Q_SLOTS: 43 void on_addLegendPB_clicked(); 44 void on_editLegendPB_clicked(); 45 void on_removeLegendPB_clicked(); 46 void on_legendsTV_itemSelectionChanged(); 47 48 private: 49 void initAddLegendDialog( DerivedAddLegendDialog& conf, 50 Qt::Alignment alignment ) const; 51 52 KChart::Chart* m_chart; 53 TableModel m_model; 54 KChart::LineDiagram* m_lines; 55 QMap<Qt::Alignment, QString> alignmentMap; 56 }; 57 58 59 #endif /* MAINWINDOW_H */ 60 61