File indexing completed on 2024-05-12 05:28:35

0001 //////////////////////////////////////////////////////////////////////////////
0002 // breezeexceptionmodel.h
0003 // -------------------
0004 //
0005 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0006 //
0007 // SPDX-License-Identifier: MIT
0008 //////////////////////////////////////////////////////////////////////////////
0009 
0010 #pragma once
0011 
0012 #include "breeze.h"
0013 #include "breezelistmodel.h"
0014 #include "breezesettings.h"
0015 
0016 namespace Breeze
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 {
0027         ColumnEnabled,
0028         ColumnType,
0029         ColumnRegExp,
0030     };
0031 
0032     //*@name methods reimplemented from base class
0033     //@{
0034 
0035     //* return data for a given index
0036     QVariant data(const QModelIndex &index, int role) const override;
0037 
0038     //* header data
0039     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0040 
0041     //* number of columns for a given index
0042     int columnCount(const QModelIndex &) const override
0043     {
0044         return nColumns;
0045     }
0046 
0047     //@}
0048 
0049 protected:
0050     //* sort
0051     void privateSort(int, Qt::SortOrder) override
0052     {
0053     }
0054 
0055 private:
0056     //* column titles
0057     static const QString m_columnTitles[nColumns];
0058 };
0059 
0060 }