![]() |
QElectroTech 0.200.1-dev
|
Functions | |
| QString | coordinateKey (double v) |
| QString | positionKey (const QPointF &pos) |
Sort-key helpers used by Diagram::toXml() to serialize elements and conductors in a deterministic order. Pulled into their own header (instead of an anonymous namespace in diagram.cpp) so they can be unit-tested directly – see tests/qttest/tst_diagramsortkeys.cpp.
|
inline |
Format a coordinate as a string that sorts the same way the number does. Plain fixed-precision formatting ("%.4f") does NOT do this – e.g. "15.0000" sorts before "5.0000" as text even though 15 > 5 – so shift into a non-negative range and zero-pad to a fixed width before comparing.

|
inline |
