Files
qelectrotech-source-mirror/tests
Beat Hangartner 7933e89dc0 Read the default conductor width from the settings as a decimal
ConductorProperties::toSettings() writes the conductor width with
QString::number(cond_size), e.g. "1.4", and fromSettings() read it back
with toInt(), which is 0 for any value that is not a whole number. A
default width of 1.4 set in the configuration became 0 on the next
start, so every new conductor was drawn with a pen of width 0.

Read it with toDouble(), and fall back to 1 when the stored value is
not a positive finite number (a hand-edited or truncated settings
file), as the other fallbacks in fromSettings() do.

No file-format change: this is the settings file only; the project
file's condsize attribute was already read with toDouble().

Tests: tst_conductorsizesetting compiles conductorproperties.cpp alone
and round-trips 2, 1.4, 0.4, 61.3 and 61.7 through toSettings() and
fromSettings() in a QSettings scope of its own; text, 0, -1, nan, inf
and a missing value give 1. Nine of the cases fail on master.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Beat Hangartner <beat@hangartners.ch>
2026-10-07 23:38:34 +02:00
..
2026-10-04 20:59:17 +02:00
2020-12-08 12:18:20 +01:00