Scribus
Open source desktop publishing at your fingertips
openpalettemodel.h
1 /***************************************************************************
2  * Copyright (C) 2009 by Pierre Marchand *
3  * pierre@oep-h.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef OPENPALETTEMODEL_H
22 #define OPENPALETTEMODEL_H
23 
24 #include <QAbstractItemModel>
25 
26 
27 
36 class OpenPaletteModel : public QAbstractItemModel
37 {
38  Q_OBJECT
40 public:
41  OpenPaletteModel( QObject * parent );
42 
44  QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
45  QModelIndex parent ( const QModelIndex & index ) const;
46  Qt::ItemFlags flags ( const QModelIndex & index ) const;
47  QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
48  QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
49  int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
50  int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
51 
52  // write
53  bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
54 
55 
56 private:
57  bool isTopIndex(const QModelIndex & index) const;
58 
59 public slots:
60  void paletteChanged();
61 
62 };
63 
64 #endif // OPENPALETTEMODEL_H
Definition: openpalettemodel.h:36
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Standard reimplementations for an abstract item model (read-only)
Definition: openpalettemodel.cpp:33