Subversion Repositories OpenInventory

Rev

Rev 129 | Rev 189 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#ifndef MYMODEL_H
#define MYMODEL_H

#include <QObject>
#include <QtGui>
#include <QSqlQueryModel>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QMap>

class MyModel : public QSqlTableModel {
Q_OBJECT
public:
    explicit MyModel(QObject *parent = 0);
    Qt::ItemFlags flags(const QModelIndex &index) const;
    bool setData(const QModelIndex &, const QVariant &, int);
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    void setPointers(QMap <int, QString> newPointers){pointers_map = newPointers;}
    QMap <int, QString> pointers(){return pointers_map;}
    void setBooleansList(QList <int> newBoolList){bolleans_list = newBoolList;}

private:
    QMap <int, QString> pointers_map; // â ýòîì ñâÿçàííîì ñïèñêå áóäåõ õðàíèòü â êà÷åñòâå êëþ÷à íîìåðÿ ñòîëáöîâ ñ óêàçàòåëÿìè
                                  // à â êà÷åñòâå çíà÷åíèé - èìåíà òàáëèö - õðàíèëèù îáúåêòîâ ðîäèòåëüñêîãî êëàññà

    QList <int> bolleans_list; // ñïèñîê ïîëåé ñ òèïîì "bool"

signals:

public slots:

};

#endif // MYMODEL_H