d/control: Recommend gdb
[gammaray-debian.git] / metapropertymodel.h
blob6e003a3538208e192aee2518826c12c4f46b1828
1 /*
2 metapropertymodel.h
4 This file is part of GammaRay, the Qt application inspection and
5 manipulation tool.
7 Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
8 Author: Volker Krause <volker.krause@kdab.com>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef GAMMARAY_METAPROPERTYMODEL_H
25 #define GAMMARAY_METAPROPERTYMODEL_H
27 #include <QtCore/QAbstractTableModel>
29 namespace GammaRay {
31 class MetaObject;
33 /** Model showing non-QObject object properties.
34 * @todo needs better name, but ObjectPropertyModel is already in use...
35 * @todo maybe it's a good to merge those to anyway?
37 class MetaPropertyModel : public QAbstractTableModel
39 Q_OBJECT
40 public:
41 explicit MetaPropertyModel(QObject *parent = 0);
43 /** Sets the object that should be represented by this model. */
44 void setObject(void *object, const QString &typeName);
45 void setObject(QObject *object);
47 int columnCount(const QModelIndex &parent = QModelIndex()) const;
48 int rowCount(const QModelIndex &parent = QModelIndex()) const;
49 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
50 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
51 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
52 Qt::ItemFlags flags(const QModelIndex &index) const;
54 private:
55 MetaObject *m_metaObject;
56 void *m_object;
61 #endif // GAMMARAY_METAPROPERTYMODEL_H