mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
Fix folio auto-num context not applying to the active diagram
BorderTitleBlock::slot_setAutoPageNum was removed in 471f876 ("Remove unused signal", 2023-10-17) without noticing autonumberingdockwidget.cpp still referenced it via old-style
SIGNAL()/SLOT() macros, which fail silently at runtime instead of producing a compile error. This has remained broken on master ever since; a fix (57572a2, "Fix two broken signal
connections") exists on the unmerged qt6-cmake-elevatormind-merged branch but that one only commented the lines out without solving the underlying issue.
Removed the dead code entirely and call BorderTitleBlock::importTitleBlock() directly on the active diagram in on_m_folio_cb_activated() instead. The same mechanism is already
used elsewhere in the codebase (undo command, new-diagram creation, XML loading) to push TitleBlockProperties into a diagram and trigger a folio numbering recompute via needFolioData().
This commit is contained in:
@@ -107,10 +107,6 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
|
|||||||
this,SLOT(folioAutoNumChanged()));
|
this,SLOT(folioAutoNumChanged()));
|
||||||
disconnect (m_project,SIGNAL(folioAutoNumAdded()),
|
disconnect (m_project,SIGNAL(folioAutoNumAdded()),
|
||||||
this,SLOT(folioAutoNumChanged()));
|
this,SLOT(folioAutoNumChanged()));
|
||||||
disconnect (this,
|
|
||||||
SIGNAL(folioAutoNumChanged(QString)),
|
|
||||||
&m_project_view->currentDiagram()->diagram()->border_and_titleblock,
|
|
||||||
SLOT (slot_setAutoPageNum(QString)));
|
|
||||||
disconnect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
|
disconnect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
|
||||||
this,SLOT(setActive()));
|
this,SLOT(setActive()));
|
||||||
|
|
||||||
@@ -146,10 +142,6 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
|
|||||||
this,SLOT(folioAutoNumChanged()));
|
this,SLOT(folioAutoNumChanged()));
|
||||||
connect (m_project,SIGNAL(folioAutoNumAdded()),
|
connect (m_project,SIGNAL(folioAutoNumAdded()),
|
||||||
this,SLOT(folioAutoNumChanged()));
|
this,SLOT(folioAutoNumChanged()));
|
||||||
connect (this,
|
|
||||||
SIGNAL(folioAutoNumChanged(QString)),
|
|
||||||
&m_project_view->currentDiagram()->diagram()->border_and_titleblock,
|
|
||||||
SLOT (slot_setAutoPageNum(QString)));
|
|
||||||
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
|
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
|
||||||
this,SLOT(setActive()));
|
this,SLOT(setActive()));
|
||||||
|
|
||||||
@@ -345,7 +337,9 @@ void AutoNumberingDockWidget::on_m_folio_cb_activated(int) {
|
|||||||
ip.folio = "%id/%total";
|
ip.folio = "%id/%total";
|
||||||
m_project->setDefaultTitleBlockProperties(ip);
|
m_project->setDefaultTitleBlockProperties(ip);
|
||||||
}
|
}
|
||||||
emit(folioAutoNumChanged(current_autonum));
|
if (m_project_view && m_project_view->currentDiagram()) {
|
||||||
|
m_project_view->currentDiagram()->diagram()->border_and_titleblock.importTitleBlock(ip);
|
||||||
|
}
|
||||||
refreshValueField(ui->m_folio_cb, ui->m_folio_value_le, AutoNumCategory::Folio);
|
refreshValueField(ui->m_folio_cb, ui->m_folio_value_le, AutoNumCategory::Folio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ class AutoNumberingDockWidget : public QDockWidget
|
|||||||
void on_m_element_value_le_editingFinished();
|
void on_m_element_value_le_editingFinished();
|
||||||
void on_m_folio_value_le_editingFinished();
|
void on_m_folio_value_le_editingFinished();
|
||||||
|
|
||||||
signals:
|
|
||||||
void folioAutoNumChanged(QString);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class AutoNumCategory { Conductor, Element, Folio };
|
enum class AutoNumCategory { Conductor, Element, Folio };
|
||||||
|
|||||||
Reference in New Issue
Block a user