diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index ce7cda3f526..a6f39d7f202 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -642,10 +642,10 @@ def qdump__QFiniteStack(d, value): def qdump__QFlags(d, value): i = value.split('{int}')[0] enumType = value.type[0] - if d.isLldb: - d.putValue(i.cast(enumType.name).display()) - else: + if d.isGdb: d.putValue(i.cast('enum ' + enumType.name).display()) + else: + d.putValue(i.cast(enumType.name).display()) d.putNumChild(0) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 7f5cd801f82..2bfb47e2b69 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1895,6 +1895,17 @@ void tst_Dumpers::dumper_data() + Check("c", "120", "@QChar"); + QTest::newRow("QFlags") + << Data("#include \n" + "enum Foo { a = 0x1, b = 0x2 };\n" + "Q_DECLARE_FLAGS(FooFlags, Foo)\n" + "Q_DECLARE_OPERATORS_FOR_FLAGS(FooFlags)\n", + "FooFlags f1(a);\n" + "FooFlags f2(a | b);\n") + + CoreProfile() + + Check("f1", "a (1)", TypeDef("QFlags", "FooFlags")) + + Check("f2", "(a | b) (3)", "FooFlags") % GdbEngine; + QTest::newRow("QDateTime") << Data("#include \n",