|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef PROJECTDBMODEL_H
19 #define PROJECTDBMODEL_H
21 #include <QAbstractTableModel>
23 #include <QDomElement>
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");}
90 #endif // PROJECTDBMODEL_H
void modelHeaderDataFromXml(const QDomElement &element, QAbstractItemModel *model)
QETXML::modelHeaderDataFromXml Restore from xml modele header data.
Definition: qetxml.cpp:501
static QString xmlTagName()
Definition: projectdbmodel.h:73
static QString diagramTranslatedInfoKey(const QString &key)
QETApp::diagramTranslatedInfoKey.
Definition: qetapp.cpp:502
void fromXml(const QDomElement &element)
ProjectDBModel::fromXml Restore the model from xml.
Definition: projectdbmodel.cpp:278
ProjectDBModel(QETProject *project, QObject *parent=nullptr)
ProjectDBModel::ProjectDBModel.
Definition: projectdbmodel.cpp:32
void setQuery(const QString &setQuery)
ProjectDBModel::setQuery Query the internall bd with query.
Definition: projectdbmodel.cpp:181
QString m_query
Definition: projectdbmodel.h:82
QString queryString() const
ProjectDBModel::queryString.
Definition: projectdbmodel.cpp:218
The ProjectDBModel class This model is intended to be use with the class projectDataBase and is desig...
Definition: projectdbmodel.h:44
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:95
QPointer< QETProject > m_project
Definition: projectdbmodel.h:81
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
ProjectDBModel::headerData Reimplemented from QAbstractTableModel.
Definition: projectdbmodel.cpp:115
int columnCount(const QModelIndex &parent=QModelIndex()) const override
ProjectDBModel::columnCount Reimplemented for QAbstractTableModel.
Definition: projectdbmodel.cpp:73
static QString elementTranslatedInfoKey(const QString &)
ElementsProperties::translatedInfo Return the translated information key given by info If info don't ...
Definition: qetapp.cpp:400
void setIdentifier(const QString &identifier)
ProjectDBModel::setIdentifier Set the identifier of this model to identifier.
Definition: projectdbmodel.cpp:303
QVector< QStringList > m_record
Definition: projectdbmodel.h:83
void dataBaseUpdated()
ProjectDBModel::dataBaseUpdated slot called when the project database is updated.
Definition: projectdbmodel.cpp:311
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
ProjectDBModel::data Reimplemented for QAbstractTableModel.
Definition: projectdbmodel.cpp:157
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:140
int rowCount(const QModelIndex &parent=QModelIndex()) const override
ProjectDBModel::rowCount Reimplemented for QAbstractTableModel.
Definition: projectdbmodel.cpp:59
QString identifier() const
Definition: projectdbmodel.h:72
QETProject * project() const
Definition: projectdbmodel.cpp:222
Definition: qetproject.h:51
QDomElement modelHeaderDataToXml(QDomDocument &parent_document, const QAbstractItemModel *model, QHash< int, QList< int >> horizontal_section_role, QHash< int, QList< int >> vertical_section_role)
QETXML::modelHeaderDataToXml Save to xml element all header data specified by horizontal_section_role...
Definition: qetxml.cpp:429
QString m_identifier
Definition: projectdbmodel.h:87
@ Vertical
Vertical segment.
Definition: qet.h:90
QHash< int, QVariant > m_index_0_0_data
Definition: projectdbmodel.h:86
QHash< int, QHash< int, QVariant > > m_header_data
Definition: projectdbmodel.h:85
@ Horizontal
Horizontal segment.
Definition: qet.h:89
void setHeaderString()
Definition: projectdbmodel.cpp:334
void fillValue()
Definition: projectdbmodel.cpp:361
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:233
QIcon tr
Definition: qeticons.cpp:206