Files
qelectrotech-source-mirror/sources
hairykiwi 64869810cd Guard elements-panel project-open auto-select against a detached item
- ElementsPanel::addProject auto-selects the first diagram via
  setCurrentItem(qtwi_project->child(0)). When a project is opened before
  the panel's first reload() has created its title-block collection items,
  indexOfTopLevelItem(common_tbt_collection_item_) returns -1 and the
  preceding insertChild() leaves qtwi_project detached from the tree model.
- The unguarded auto-select leaves a detached/invalid current item -- an
  intermittent SIGSEGV in QTreeModel::index()/parent() on some builds; on
  current master with Qt 6.11.2 the test shows the invalid selection without
  a fault. Calling setCurrentItem() on an item the QTreeModel does not own is
  unsafe; guard the auto-select with qtwi_project->treeWidget() so it runs
  only when the item is attached.
- No behavioural change in the normal case: reload() re-adds the project
  attached shortly after and performs the selection then.
- Pre-existing since a82f6de23 ("Add highlight current page in ProjectView").

Assisted-by: Claude Code
Signed-off-by: hairykiwi <174199+hairykiwi@users.noreply.github.com>
2026-10-18 13:44:35 +01:00
..
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-10-03 18:09:33 +02:00
2026-01-16 15:24:35 +01:00
2026-04-26 10:48:47 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-10-12 16:02:26 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-17 10:29:13 +02:00
2026-07-17 10:29:13 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00