mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 17:34:12 +02:00
9749985089
XRefProperties read the stored cross-reference position with QMetaEnum::keyToValue() and cast the result straight to Qt::AlignmentFlag. An empty value gives -1. Earlier versions saved xrefpos="" into projects and the settings file (18 of the 29 shipped examples that carry cross-reference settings have it), and -1 matches no branch of DynamicElementTextItem::setXref_item(), so the cross-reference stayed at (0,0): the top-left corner of the label, on top of it. fromXml() fell back to AlignBottom only when the attribute was missing, and fromSettings() only when the key was missing (#296), so an empty value kept producing the bad position and was saved back empty on every save. Both now go through one helper that returns AlignBottom for an empty, unknown, or not-offered value. The next save writes "AlignBottom", so affected projects heal once resaved. tst_xrefpos covers fromXml(), fromSettings() and the rewrite on save; it fails 5 of 14 cases without this change. Exporting examples/2612_ats_singlephase.qet to SVG before and after shows every slave cross-reference moving from over its label to below it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELKpbGxqJd7EFiTUypBtVe