18#ifndef PROJECTDBMODEL_H
19#define PROJECTDBMODEL_H
21#include <QAbstractTableModel>
51 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
52 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
54 Qt::Orientation orientation,
55 const QVariant &value,
56 int role = Qt::EditRole)
override;
58 Qt::Orientation orientation,
59 int role = Qt::DisplayRole)
const override;
60 bool setData(
const QModelIndex &index,
61 const QVariant &value,
62 int role = Qt::EditRole)
override;
63 QVariant
data(
const QModelIndex &index,
64 int role = Qt::DisplayRole)
const override;
69 QDomElement
toXml(QDomDocument &document)
const;
70 void fromXml(
const QDomElement &element);
73 static QString
xmlTagName() {
return QString(
"project_data_base_model");}
The ProjectDBModel class This model is intended to be use with the class projectDataBase and is desig...
Definition projectdbmodel.h:44
static QString xmlTagName()
Definition projectdbmodel.h:73
QVector< QStringList > m_record
Definition projectdbmodel.h:83
int rowCount(const QModelIndex &parent=QModelIndex()) const override
ProjectDBModel::rowCount Reimplemented for QAbstractTableModel.
Definition projectdbmodel.cpp:61
QString m_query
Definition projectdbmodel.h:82
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
ProjectDBModel::setData Only store the data for the index 0.0.
Definition projectdbmodel.cpp:142
QString identifier() const
Definition projectdbmodel.h:72
void fromXml(const QDomElement &element)
ProjectDBModel::fromXml Restore the model from xml.
Definition projectdbmodel.cpp:282
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
ProjectDBModel::headerData Reimplemented from QAbstractTableModel.
Definition projectdbmodel.cpp:117
QHash< int, QVariant > m_index_0_0_data
Definition projectdbmodel.h:86
void setHeaderString()
Definition projectdbmodel.cpp:338
void setIdentifier(const QString &identifier)
ProjectDBModel::setIdentifier Set the identifier of this model to identifier.
Definition projectdbmodel.cpp:307
void setQuery(const QString &setQuery)
ProjectDBModel::setQuery Query the internal bd with query.
Definition projectdbmodel.cpp:183
QETProject * project() const
Definition projectdbmodel.cpp:225
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
ProjectDBModel::setHeaderData Reimplemented from QAbstractTableModel. Only horizontal orientation is ...
Definition projectdbmodel.cpp:97
void fillValue()
Definition projectdbmodel.cpp:362
void dataBaseUpdated()
ProjectDBModel::dataBaseUpdated slot called when the project database is updated.
Definition projectdbmodel.cpp:315
QDomElement toXml(QDomDocument &document) const
ProjectDBModel::toXml Save the model to xml,since model can have unlimited data we only save few data...
Definition projectdbmodel.cpp:237
QHash< int, QHash< int, QVariant > > m_header_data
Definition projectdbmodel.h:85
QString m_identifier
Definition projectdbmodel.h:87
QPointer< QETProject > m_project
Definition projectdbmodel.h:81
int columnCount(const QModelIndex &parent=QModelIndex()) const override
ProjectDBModel::columnCount Reimplemented for QAbstractTableModel.
Definition projectdbmodel.cpp:75
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
ProjectDBModel::data Reimplemented for QAbstractTableModel.
Definition projectdbmodel.cpp:159
QString queryString() const
ProjectDBModel::queryString.
Definition projectdbmodel.cpp:220
Definition qetproject.h:62