diff --git a/sources/dataBase/projectdatabase.cpp b/sources/dataBase/projectdatabase.cpp index a0e22d3ae..b0261be0f 100644 --- a/sources/dataBase/projectdatabase.cpp +++ b/sources/dataBase/projectdatabase.cpp @@ -412,7 +412,7 @@ void projectDataBase::populateElementTable() for (auto diagram : m_project->diagrams()) { ElementProvider ep(diagram); - QList elements_list = ep.find(Element::Simple | Element::Terminale | Element::Master); + QList elements_list = ep.find(Element::Simple | Element::Terminale | Element::Master | Element::Thumbnail); //Insert all value into the database for (auto elmt : elements_list) { @@ -440,7 +440,7 @@ void projectDataBase::populateElementInfoTable() for (auto *diagram : m_project->diagrams()) { ElementProvider ep(diagram); - QList elements_list = ep.find(Element::Simple | Element::Terminale | Element::Master); + QList elements_list = ep.find(Element::Simple | Element::Terminale | Element::Master| Element::Thumbnail); //Insert all value into the database for (auto elmt : elements_list) diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index e9d82b72c..be7678260 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -45,6 +45,7 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) : m_button_group.addButton(ui->m_button_cb, 3); m_button_group.addButton(ui->m_coil_cb, 4); m_button_group.addButton(ui->m_protection_cb, 5); + m_button_group.addButton(ui->m_thumbnail_cb,6); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove connect(&m_button_group, static_cast(&QButtonGroup::buttonClicked), [this](int id) #else @@ -185,8 +186,13 @@ void ElementQueryWidget::setQuery(const QString &query) if (ui->m_protection_cb) { ++c; } + + ui->m_thumbnail_cb->setChecked (str_type.contains("Thumbnail") ? true : false); + if (ui->m_thumbnail_cb->isChecked()) { + ++c; + } - if (c == 5) { + if (c == 6) { ui->m_all_cb->setCheckState(Qt::Checked); } else if (c > 0) { ui->m_all_cb->setCheckState(Qt::PartiallyChecked); @@ -337,6 +343,11 @@ QString ElementQueryWidget::queryStr() const where += " element_type = 'Terminale'"; b = true; } + if (ui->m_thumbnail_cb->isChecked()) { + if (b) where +=" OR"; + where += " element_type = 'thumbnail'"; + b = true; + } if (ui->m_simple_cb->isChecked()) { if (b) where +=" OR"; where += " element_type = 'Simple'"; diff --git a/sources/dataBase/ui/elementquerywidget.ui b/sources/dataBase/ui/elementquerywidget.ui index 3973c78ab..f16469e24 100644 --- a/sources/dataBase/ui/elementquerywidget.ui +++ b/sources/dataBase/ui/elementquerywidget.ui @@ -7,7 +7,7 @@ 0 0 341 - 527 + 557 @@ -242,7 +242,7 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + Simples @@ -252,6 +252,16 @@ + + + + Organes de protection + + + true + + + @@ -272,7 +282,7 @@ - + Boutons et commutateurs @@ -282,7 +292,7 @@ - + Borniers @@ -292,10 +302,10 @@ - - + + - Organes de protection + Vignettes true diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index c3cd4d4cb..d72fdddc9 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -165,6 +165,9 @@ void ElementPropertiesEditorWidget::updateTree() case ElementData::Simple: ui->m_tree->setEnabled(true); break; + case ElementData::Thumbnail: + ui->m_tree->setEnabled(true); + break; case ElementData::NextReport: ui->m_tree->setDisabled(true); break; diff --git a/sources/properties/elementdata.cpp b/sources/properties/elementdata.cpp index 44025a939..682340e48 100644 --- a/sources/properties/elementdata.cpp +++ b/sources/properties/elementdata.cpp @@ -312,7 +312,7 @@ QString ElementData::typeToString(ElementData::Type type) case ElementData::Terminale : return QString("terminal"); case ElementData::Thumbnail: - return QStringLiteral("thumbnail"); + return QString("thumbnail"); default: qDebug() << "ElementData::typeToString : type don't exist" << "return failsafe value 'simple'"; @@ -334,7 +334,7 @@ ElementData::Type ElementData::typeFromString(const QString &string) return ElementData::Slave; } else if (string == "terminal") { return ElementData::Terminale; - } else if (string == QLatin1String("thumbnail")) { + } else if (string == "thumbnail") { return ElementData::Thumbnail; } @@ -559,6 +559,7 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element) } else if (name == "function") { m_terminal_function = terminalFunctionFromString(dom_elmt.text()); } + } } } diff --git a/sources/qetgraphicsitem/element.h b/sources/qetgraphicsitem/element.h index a732569ef..56c4020b5 100644 --- a/sources/qetgraphicsitem/element.h +++ b/sources/qetgraphicsitem/element.h @@ -57,7 +57,8 @@ class Element : public QetGraphicsItem AllReport = 6, Master = 8, Slave = 16, - Terminale = 32}; + Terminale = 32, + Thumbnail = 64}; Element(const ElementsLocation &location, QGraphicsItem * = nullptr, diff --git a/sources/ui/elementpropertieswidget.cpp b/sources/ui/elementpropertieswidget.cpp index 0e248fc1a..9690516c7 100644 --- a/sources/ui/elementpropertieswidget.cpp +++ b/sources/ui/elementpropertieswidget.cpp @@ -289,6 +289,9 @@ void ElementPropertiesWidget::updateUi() case Element::Simple: m_list_editor << new ElementInfoWidget(m_element, this); break; + case Element::Thumbnail: + m_list_editor << new ElementInfoWidget(m_element, this); + break; case Element::NextReport: m_list_editor << new LinkSingleElementWidget(m_element, this); break;