Qt Widgets Designer: Return std::optional from the enum helpers


MetaEnum::valueToKey(), MetaEnum::keyToValue(),
DesignerMetaEnum::toString(), DesignerMetaEnum::parseEnum() and
DesignerMetaFlags::parseFlags() reported failure via a bool *ok
out-parameter while returning a default-constructed value. Return
std::optional instead and adapt the call sites.

Pick-to: 6.12
Change-Id: Iab5565100c24a6fb1bd2f20c2dc1f1e855188c01
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
commit608d0878e0bc24985b19a1f11296a6a9b9c95c36
parentd93ab86bd090e97dc93af5e5a8e3e0ef6a4aa79a
authorJarek Kobus <jaroslaw.kobus@qt.io>
committerJarek Kobus <jaroslaw.kobus@qt.io>
commit timeTue, 15 Sep 2026 15:51:29 +0000