Qt Widgets Designer: Trim whitespace around enumeration values
XML content may be wrapped or indented, so <set>/<enum> can carry
leading and trailing whitespace. MetaEnum::keyToValue() looked the key
up verbatim, so loading such a form warned that the value "could not be
converted to a flag value" and dropped the property.
Trim the value as a whole in parseEnum() and parseFlags(), and reject
what still holds whitespace other than a plain space. That matches uic,
whose checkEnumValue() accepts ':', '|', ' ' and identifier characters
only: what uic refuses would end up verbatim in the generated C++ or
Python code, so accepting it here would load a form that fails to
build. Erring the other way is worse still, since a failed parse leaves
the property at 0 and Designer writes that back on save.
Keep trimming each key in keyToValue(), which by then can only see the
spaces around the '|' separator.
Fixes: QTBUG-149632
Pick-to: 6.12 6.11 6.8
Change-Id: I03cb6201dbbb3d818af5819736e26b7c91e7448d
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>