QETProject have is own database + add widget to edit nomenclature model

QETProject have is own ProjectDataBase, then when the database is
updated, everything that need the database is also updated trough the
signal emitted by the database.
Begin a widget to edit the NomenclatureModel
This commit is contained in:
Claveau Joshua
2020-03-29 18:17:27 +02:00
parent 66abfbe180
commit 8819146a01
16 changed files with 764 additions and 423 deletions

View File

@@ -46,7 +46,8 @@ static int BACKUP_INTERVAL = 120000; //interval in ms of backup = 2min
*/
QETProject::QETProject(QObject *parent) :
QObject (parent),
m_titleblocks_collection(this)
m_titleblocks_collection(this),
m_data_base(this, this)
{
m_elements_collection = new XmlElementCollection(this);
init();
@@ -60,7 +61,8 @@ QETProject::QETProject(QObject *parent) :
*/
QETProject::QETProject(const QString &path, QObject *parent) :
QObject (parent),
m_titleblocks_collection(this)
m_titleblocks_collection(this),
m_data_base(this, this)
{
QFile file(path);
m_state = openFile(&file);
@@ -78,7 +80,8 @@ QETProject::QETProject(const QString &path, QObject *parent) :
*/
QETProject::QETProject(KAutoSaveFile *backup, QObject *parent) :
QObject (parent),
m_titleblocks_collection(this)
m_titleblocks_collection(this),
m_data_base(this, this)
{
m_state = openFile(backup);
//Failed to open from the backup, try to open the crashed
@@ -112,6 +115,14 @@ QETProject::~QETProject() {
qDeleteAll(m_diagrams_list);
}
/**
* @brief QETProject::dataBase
* @return The data base of this project
*/
projectDataBase *QETProject::dataBase() {
return &m_data_base;
}
/**
* @brief QETProject::uuid
* @return the uuid of this project