File indexing completed on 2023-10-03 06:50:25
0001 /************************************************************************************* 0002 * Copyright (C) 2010-2012 by Percy Camilo T. Aucahuasi <percy.camilo.ta@gmail.com> * 0003 * Copyright (C) 2012 by Aleix Pol Gonzalez <aleixpol@kde.org> * 0004 * * 0005 * This program is free software; you can redistribute it and/or * 0006 * modify it under the terms of the GNU General Public License * 0007 * as published by the Free Software Foundation; either version 2 * 0008 * of the License, or (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the Free Software * 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 0018 *************************************************************************************/ 0019 0020 #ifndef ANALITZAPLOT_PLOTSDICTIONARYMODEL_H 0021 #define ANALITZAPLOT_PLOTSDICTIONARYMODEL_H 0022 0023 #include <QStandardItemModel> 0024 #include <QPointer> 0025 #include <analitzaplot/plottingenums.h> 0026 #include "analitzaplotexport.h" 0027 namespace Analitza 0028 { 0029 class PlotsModel; 0030 0031 //WARNING @PlotsDictionaryModel needs dictionary files (*.plots), currently we 0032 //are working to add plots files for next version coming (kde >= 4.10.x). 0033 0034 class ANALITZAPLOT_EXPORT PlotsDictionaryModel : public QStandardItemModel 0035 { 0036 Q_OBJECT 0037 public: 0038 enum Roles { ExpressionRole = Qt::UserRole+1, FileRole }; 0039 explicit PlotsDictionaryModel(QObject* parent = nullptr); 0040 ~PlotsDictionaryModel() override; 0041 0042 int currentRow() const; 0043 void setCurrentRow(int row); 0044 0045 PlotsModel* plotModel(); 0046 void createDictionary(const QString& path); 0047 void createAllDictionaries(); 0048 Analitza::Dimension dimension(); 0049 0050 public Q_SLOTS: 0051 ///convenience class for currentRow 0052 void setCurrentIndex(const QModelIndex& idx); 0053 0054 private: 0055 void updatePlotsModel(); 0056 QPointer<PlotsModel> m_plots; 0057 int m_currentItem; 0058 }; 0059 0060 } 0061 0062 #endif