File indexing completed on 2024-05-19 05:35:17

0001 #ifndef oxygenexceptionmodel_h
0002 #define oxygenexceptionmodel_h
0003 //////////////////////////////////////////////////////////////////////////////
0004 // oxygenexceptionmodel.h
0005 // -------------------
0006 //
0007 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0008 //
0009 // SPDX-License-Identifier: MIT
0010 //////////////////////////////////////////////////////////////////////////////
0011 
0012 #include "oxygen.h"
0013 #include "oxygenlistmodel.h"
0014 #include "oxygensettings.h"
0015 
0016 namespace Oxygen
0017 {
0018 //* qlistview for object counters
0019 class ExceptionModel : public ListModel<InternalSettingsPtr>
0020 {
0021 public:
0022     //* number of columns
0023     enum { nColumns = 3 };
0024 
0025     //* column type enumeration
0026     enum ColumnType { ColumnEnabled, ColumnType, ColumnRegExp };
0027 
0028     //*@name methods reimplemented from base class
0029     //@{
0030 
0031     //* return data for a given index
0032     QVariant data(const QModelIndex &index, int role) const override;
0033 
0034     //* header data
0035     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0036 
0037     //* number of columns for a given index
0038     int columnCount(const QModelIndex &) const override
0039     {
0040         return nColumns;
0041     }
0042 
0043     //@}
0044 
0045 protected:
0046     //* sort
0047     void privateSort(int, Qt::SortOrder) override
0048     {
0049     }
0050 
0051 private:
0052     //* column titles
0053     static const QString m_columnTitles[nColumns];
0054 };
0055 }
0056 #endif