~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/migration/AlterSchemaTableModel.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
4
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
18
*/
 
19
 
 
20
#ifndef ALTERSCHEMATABLEMODEL_H
 
21
#define ALTERSCHEMATABLEMODEL_H
 
22
 
 
23
#include <QModelIndex>
 
24
#include <QList>
 
25
 
 
26
#include <KDbRecordData>
 
27
 
 
28
class KDbTableSchema;
 
29
 
 
30
class AlterSchemaTableModel : public QAbstractTableModel
 
31
{
 
32
    Q_OBJECT
 
33
public:
 
34
    explicit AlterSchemaTableModel(QObject* parent = nullptr);
 
35
    ~AlterSchemaTableModel();
 
36
 
 
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;
 
41
 
 
42
    void setSchema(KDbTableSchema *schema);
 
43
    void setData(QList<KDbRecordData*> *data);
 
44
    void setRowCount(int i);
 
45
private:
 
46
    //! Reimplemented just to avoid 'hidden' warnings
 
47
    bool setData(const QModelIndex & index, const QVariant & value,
 
48
                 int role = Qt::EditRole) Q_DECL_OVERRIDE
 
49
    {
 
50
        return QAbstractTableModel::setData(index, value, role);
 
51
    }
 
52
 
 
53
    KDbTableSchema *m_schema;
 
54
    QList<KDbRecordData*> *m_data; //!< Small amount of data to display to user
 
55
    int m_recordCount;
 
56
};
 
57
 
 
58
#endif // ALTERSCHEMATABLEMODEL_H