1
/* This file is part of the KDE project
2
Copyright (C) 2009 Adam Pigg <adam@piggz.co.uk>
3
Copyright (C) 2009-2016 Jarosław Staniek <staniek@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
20
#ifndef ALTERSCHEMATABLEMODEL_H
21
#define ALTERSCHEMATABLEMODEL_H
23
#include <QModelIndex>
26
#include <KDbRecordData>
30
class AlterSchemaTableModel : public QAbstractTableModel
34
explicit AlterSchemaTableModel(QObject* parent = nullptr);
35
~AlterSchemaTableModel();
37
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
38
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
39
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
40
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
42
void setSchema(KDbTableSchema *schema);
43
void setData(QList<KDbRecordData*> *data);
44
void setRowCount(int i);
46
//! Reimplemented just to avoid 'hidden' warnings
47
bool setData(const QModelIndex & index, const QVariant & value,
48
int role = Qt::EditRole) Q_DECL_OVERRIDE
50
return QAbstractTableModel::setData(index, value, role);
53
KDbTableSchema *m_schema;
54
QList<KDbRecordData*> *m_data; //!< Small amount of data to display to user
58
#endif // ALTERSCHEMATABLEMODEL_H