From adcf11270c4e25bfa38cffead6c0ff8267c2770a Mon Sep 17 00:00:00 2001 From: ispyisail Date: Mon, 28 Sep 2026 05:55:20 +1300 Subject: [PATCH] Upgrade old element type names in saved query presets too A query saved to nomenclature.json (Load/Save in the query editor, since 2020) before June 2022 still says element_type = 'Simple'. Loading it ticked none of the type boxes and kept the old query, so the new table came out empty. Pass it through LegacyElementTypes::upgradeQuery() as ProjectDBModel::fromXml() now does. Co-Authored-By: Claude Opus 5.5 --- sources/dataBase/ui/elementquerywidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index f5a42beb7..6331efb63 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -20,6 +20,7 @@ #include "../../properties/elementdata.h" #include "../../qetapp.h" #include "../../qetinformation.h" +#include "../legacyelementtypes.h" #include "../projectdatabase.h" #include "ui_elementquerywidget.h" @@ -674,7 +675,9 @@ void ElementQueryWidget::on_m_load_pb_clicked() auto value_object = value.toObject(); if (value_object.value("query").isString()) { - setQuery(value_object.value("query").toString()); + //A query saved before June 2022 names element types the old way + setQuery(LegacyElementTypes::upgradeQuery( + value_object.value("query").toString())); } }