Subversion Repositories OpenInventory

Rev

Rev 127 | Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 127 Rev 128
Line 3... Line 3...
3
3
4
#include <QObject>
4
#include <QObject>
5
#include <QtGui>
5
#include <QtGui>
6
#include <QSqlQueryModel>
6
#include <QSqlQueryModel>
7
#include <QSqlTableModel>
7
#include <QSqlTableModel>
-
 
8
#include <QMap>
8
9
9
class MyModel : public QSqlTableModel {
10
class MyModel : public QSqlTableModel {
10
Q_OBJECT
11
Q_OBJECT
11
public:
12
public:
12
    explicit MyModel(QObject *parent = 0);
13
    explicit MyModel(QObject *parent = 0);
13
    Qt::ItemFlags flags(const QModelIndex &index) const;
14
    Qt::ItemFlags flags(const QModelIndex &index) const;
14
    bool setData(const QModelIndex &, const QVariant &, int);
15
    bool setData(const QModelIndex &, const QVariant &, int);
15
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
16
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-
 
17
    void setPointers(QMap <int, QString> newPointers){pointers_map = newPointers;}
-
 
18
    QMap <int, QString> pointers(){return pointers_map;}
-
 
19
private:
-
 
20
    QMap <int, QString> pointers_map; // â ýòîì ñâÿçàííîì ñïèñêå áóäåõ õðàíèòü â êà÷åñòâå êëþ÷à íîìåðÿ ñòîëáöîâ ñ óêàçàòåëÿìè
-
 
21
                                  // à â êà÷åñòâå çíà÷åíèé - èìåíà òàáëèö - õðàíèëèù îáúåêòîâ ðîäèòåëüñêîãî êëàññà
16
22
17
signals:
23
signals:
18
24
19
public slots:
25
public slots:
20
26