Files
qelectrotech-source-mirror/sources/scripting
ispyisail fd962619b5 Scripting: look up a table or a symbol text field by its uuid
qet.textIndex(), shapeIndex() and imageIndex() turn a free text's, shape's
or picture's uuid into the index the other calls take. Tables and symbol
text fields had no such lookup, so a script could only name them by index,
and an index shifts when an earlier item is deleted: a script that deletes
table 0 and then moves "table 1" moves the wrong table.

- qet.tableIndex(folio, uuid): the table's current index in tables(folio),
  or -1.
- qet.elementTextIndex(folio, elementUuid, textUuid): the field's current
  index in elementTexts(folio, elementUuid), or -1. The element is part of
  the address because a field's uuid is unique only within its element:
  copying an element keeps its fields' uuids (2612_ats_singlephase.qet has
  one field uuid on 20 copies).

Tests in misc/qet-mcp's integration suite, which drives these through
--run: a table followed across a deletion of the one before it, and the
same field uuid resolving on two copies to each copy's own field. Both
fail against a build without this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 13:29:24 +13:00
..