diff --git a/share/qtcreator/debugger/libcpp_stdtypes.py b/share/qtcreator/debugger/libcpp_stdtypes.py index bce83a4fe68..44b3a235ffd 100644 --- a/share/qtcreator/debugger/libcpp_stdtypes.py +++ b/share/qtcreator/debugger/libcpp_stdtypes.py @@ -508,12 +508,9 @@ def qdump__std____1__variant(d, value): def qdump__std____1__optional(d, value): if value['__engaged_'].integer() == 0: - d.putSpecialValue("uninitialized") - d.putNumChild(2) - if d.isExpanded(): - with Children(d): - d.putSubItem("engaged", value['__engaged_']) - d.putSubItem("value", value['#1']['__val_']) + d.putSpecialValue("empty") + else: + d.putItem(value['#1']['__val_']) def qdump__std____1__tuple(d, value): diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index 5b8b699165c..c14812dee1d 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -1108,7 +1108,7 @@ def qdump__std__optional(d, value): d.putItem(payload) d.putBetterType(innerType) else: - d.putSpecialValue("uninitialized") + d.putSpecialValue("empty") def qdump__std__experimental__optional(d, value): diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 8d8c8f70d38..c59dbf97ec6 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5627,7 +5627,7 @@ void tst_Dumpers::dumper_data() + Cxx17Profile() - + Check("o1", "", "std::optional") + + Check("o1", "", "std::optional") + Check("o2", "1", "bool") // 1 -> true is done on display + Check("o3", "<3 items>", "std::vector") + Check("o3.1", "[1]", "2", "int");