File: sqlqueryrownummodel.h

package info (click to toggle)
sqlitestudio 3.4.21%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,880 kB
  • sloc: ansic: 406,208; cpp: 123,872; yacc: 2,692; tcl: 497; sh: 462; xml: 426; makefile: 19
file content (27 lines) | stat: -rw-r--r-- 906 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SQLQUERYROWNUMMODEL_H
#define SQLQUERYROWNUMMODEL_H

#include "guiSQLiteStudio_global.h"
#include <QAbstractItemModel>

class GUI_API_EXPORT SqlQueryRowNumModel : public QAbstractItemModel
{
        Q_OBJECT
    public:
        SqlQueryRowNumModel(QAbstractItemModel *value, QObject *parent = 0);

        QModelIndex index(int row, int column, const QModelIndex &parent) const;
        QModelIndex parent(const QModelIndex &child) const;
        int rowCount(const QModelIndex &parent) const;
        int columnCount(const QModelIndex &parent) const;
        QVariant data(const QModelIndex &index, int role) const;
        QVariant headerData(int section, Qt::Orientation orientation, int role) const;

        void setRowNumBase(int value);

    private:
        int rowNumBase = 1;
        QAbstractItemModel* mainModel = nullptr;
};

#endif // SQLQUERYROWNUMMODEL_H