Revamp the structur of project database

This commit is contained in:
Claveau Joshua
2020-04-04 17:43:58 +02:00
parent b7d3db1ce6
commit 035709b70f
11 changed files with 224 additions and 68 deletions

View File

@@ -412,7 +412,11 @@ void QETDiagramEditor::setUpActions()
/*******ONLY FOR TEST DURING DEVEL*********/
auto model = new NomenclatureModel(this->currentProject(), this->currentProject());
model->query("SELECT plant, location, label, pos, comment, description FROM element_info ORDER BY plant, location, label, comment, description");
QString query("SELECT ei.plant AS plant, ei.location AS location, di.title AS title, ei.label AS label, ei.comment AS comment, e.pos AS pos"
" FROM element_info ei, element e, diagram_info di"
" WHERE ei.element_uuid = e.uuid AND e.diagram_uuid = di.diagram_uuid"
" ORDER BY plant, location, title, label, pos");
model->query(query);
model->setData(model->index(0,0), Qt::AlignLeft, Qt::TextAlignmentRole);
model->setData(model->index(0,0), QETApp::diagramTextsFont(), Qt::FontRole);
model->setHeaderData(0, Qt::Horizontal, Qt::AlignHCenter, Qt::TextAlignmentRole);