1 #ifndef oxygenexceptionmodel_h 2 #define oxygenexceptionmodel_h 3 ////////////////////////////////////////////////////////////////////////////// 4 // oxygenexceptionmodel.h 5 // ------------------- 6 // 7 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr> 8 // 9 // SPDX-License-Identifier: MIT 10 ////////////////////////////////////////////////////////////////////////////// 11 12 #include "oxygenlistmodel.h" 13 #include "oxygensettings.h" 14 #include "oxygen.h" 15 16 namespace Oxygen 17 { 18 19 //* qlistview for object counters 20 class ExceptionModel: public ListModel<InternalSettingsPtr> 21 { 22 23 public: 24 25 //* number of columns 26 enum { nColumns = 3 }; 27 28 //* column type enumeration 29 enum ColumnType { 30 ColumnEnabled, 31 ColumnType, 32 ColumnRegExp 33 }; 34 35 36 //*@name methods reimplemented from base class 37 //@{ 38 39 //* return data for a given index 40 QVariant data(const QModelIndex &index, int role) const override; 41 42 //* header data 43 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 44 45 //* number of columns for a given index columnCount(const QModelIndex &)46 int columnCount(const QModelIndex& ) const override 47 { return nColumns; } 48 49 //@} 50 51 protected: 52 53 //* sort privateSort(int,Qt::SortOrder)54 void privateSort( int, Qt::SortOrder ) override 55 {} 56 57 private: 58 59 //* column titles 60 static const QString m_columnTitles[ nColumns ]; 61 62 }; 63 64 } 65 #endif 66