mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-07 13:54:12 +02:00
Merge branch 'master' into qt6_cmake_joshua
This commit is contained in:
@@ -114,6 +114,11 @@ QSqlQuery projectDataBase::newQuery(const QString &query) {
|
||||
*/
|
||||
void projectDataBase::addElement(Element *element)
|
||||
{
|
||||
if (!element || !element->diagram()) {
|
||||
qDebug() << "projectDataBase::addElement: null element or diagram";
|
||||
return;
|
||||
}
|
||||
|
||||
m_insert_elements_query.bindValue(":uuid", element->uuid().toString());
|
||||
m_insert_elements_query.bindValue(":diagram_uuid", element->diagram()->uuid().toString());
|
||||
m_insert_elements_query.bindValue(":pos", element->diagram()->convertPosition(element->scenePos()).toString());
|
||||
@@ -253,9 +258,9 @@ bool projectDataBase::createDataBase()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_data_base.exec("PRAGMA temp_store = MEMORY");
|
||||
m_data_base.exec("PRAGMA journal_mode = MEMORY");
|
||||
m_data_base.exec("PRAGMA synchronous = OFF");
|
||||
QSqlQuery(m_data_base).exec("PRAGMA temp_store = MEMORY");
|
||||
QSqlQuery(m_data_base).exec("PRAGMA journal_mode = MEMORY");
|
||||
QSqlQuery(m_data_base).exec("PRAGMA synchronous = OFF");
|
||||
|
||||
QSqlQuery query_(m_data_base);
|
||||
bool first_ = true;
|
||||
@@ -383,7 +388,7 @@ void projectDataBase::createElementNomenclatureView()
|
||||
"ei.supplier_auxiliary4 AS supplier_auxiliary4,"
|
||||
"ei.quantity_auxiliary4 AS quantity_auxiliary4,"
|
||||
"ei.unity_auxiliary4 AS unity_auxiliary4,"
|
||||
|
||||
"ei.exclude_from_bom AS exclude_from_bom,"
|
||||
|
||||
"d.pos AS diagram_position,"
|
||||
"e.type AS element_type,"
|
||||
@@ -392,7 +397,7 @@ void projectDataBase::createElementNomenclatureView()
|
||||
"di.folio AS folio,"
|
||||
"e.pos AS position "
|
||||
" FROM element_info ei, diagram_info di, element e, diagram d"
|
||||
" WHERE ei.element_uuid = e.uuid AND e.diagram_uuid = d.uuid AND di.diagram_uuid = d.uuid");
|
||||
" WHERE ei.element_uuid = e.uuid AND e.diagram_uuid = d.uuid AND di.diagram_uuid = d.uuid AND (ei.exclude_from_bom IS NOT 'true')");
|
||||
|
||||
QSqlQuery query(m_data_base);
|
||||
if (!query.exec(create_view)) {
|
||||
|
||||
Reference in New Issue
Block a user