diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 3c5e8586a4e..e59cdd861b8 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -167,11 +167,10 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data() QTest::addColumn >("expectedUnnamedQuickTestsCount"); QTest::addColumn >("expectedDataTagsCount"); - QStringList projects = QStringList() - << QString(m_tmpDir->path() + QLatin1String("/plain/plain.pro")) - << QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.pro")) - << QString(m_tmpDir->path() + QLatin1String("/plain/plain.qbs")) - << QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.qbs")); + QStringList projects = QStringList({ m_tmpDir->path() + "/plain/plain.pro", + m_tmpDir->path() + "/mixed_atp/mixed_atp.pro", + m_tmpDir->path() + "/plain/plain.qbs", + m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs" }); QList expectedAutoTests = QList() << 1 << 4 << 1 << 4; QList expectedNamedQuickTests = QList() << 0 << 5 << 0 << 5; diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 27cb35739ea..1643550bbc1 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -371,17 +371,12 @@ void CppToolsPlugin::test_global_completion_data() const QByteArray codeTemplate = "int myGlobal;\n" "\n" "@\n"; - const QStringList replacements = QStringList() - << QLatin1String("// text") - << QLatin1String("// text.") - << QLatin1String("/// text") - << QLatin1String("/// text.") - ; + const QStringList replacements = QStringList({ "// text", "// text.", "/// text", "/// text." }); foreach (const QString &replacement, replacements) { QByteArray code = codeTemplate; code.replace("", replacement.toUtf8()); const QByteArray tag = _("completion after comment: ") + replacement.toUtf8(); - QTest::newRow(tag) << code << QByteArray() << QStringList(QLatin1String("myGlobal")); + QTest::newRow(tag) << code << QByteArray() << QStringList("myGlobal"); } } @@ -432,24 +427,14 @@ static void enumTestCase(const QByteArray &tag, const QByteArray &source, QByteArray fullSource = source; fullSource.replace('$', "enum E { val1, val2, val3 };"); QTest::newRow(tag) << fullSource << (prefix + "val") - << (QStringList() - << QLatin1String("val1") - << QLatin1String("val2") - << QLatin1String("val3")); + << QStringList({ "val1", "val2", "val3" }); QTest::newRow(tag + "_cxx11") << fullSource << (prefix + "E::") - << (QStringList() - << QLatin1String("E") - << QLatin1String("val1") - << QLatin1String("val2") - << QLatin1String("val3")); + << QStringList({ "E", "val1", "val2", "val3" }); fullSource.replace("enum E ", "enum "); QTest::newRow(tag + "_anon") << fullSource << (prefix + "val") - << (QStringList() - << QLatin1String("val1") - << QLatin1String("val2") - << QLatin1String("val3")); + << QStringList({ "val1", "val2", "val3" }); } void CppToolsPlugin::test_completion_data() @@ -471,8 +456,7 @@ void CppToolsPlugin::test_completion_data() "};\n" "\n" "@\n" - ) << _("Foo::Bar::") << (QStringList() - << QLatin1String("Bar")); + ) << _("Foo::Bar::") << QStringList("Bar"); QTest::newRow("inside_parentheses_c_style_conversion") << _( "class Base\n" @@ -491,11 +475,7 @@ void CppToolsPlugin::test_completion_data() " if (1)\n" " @;\n" "}\n" - ) << _("((Derived *)b)->") << (QStringList() - << QLatin1String("Derived") - << QLatin1String("Base") - << QLatin1String("i_derived") - << QLatin1String("i_base")); + ) << _("((Derived *)b)->") << QStringList({ "Derived", "Base", "i_derived", "i_base" }); QTest::newRow("inside_parentheses_cast_operator_conversion") << _( "class Base\n" @@ -514,11 +494,8 @@ void CppToolsPlugin::test_completion_data() " if (1)\n" " @;\n" "}\n" - ) << _("(static_cast(b))->") << (QStringList() - << QLatin1String("Derived") - << QLatin1String("Base") - << QLatin1String("i_derived") - << QLatin1String("i_base")); + ) << _("(static_cast(b))->") << QStringList({ "Derived", "Base", "i_derived", + "i_base" }); QTest::newRow("template_1") << _( "template \n" @@ -533,11 +510,7 @@ void CppToolsPlugin::test_completion_data() " Foo f;\n" " @\n" "}" - ) << _("Foo::") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("Type") - << QLatin1String("foo") - << QLatin1String("m")); + ) << _("Foo::") << QStringList({ "Foo", "Type", "foo", "m" }); QTest::newRow("template_2") << _( "template \n" @@ -552,10 +525,7 @@ void CppToolsPlugin::test_completion_data() " List l;\n" " @\n" "}" - ) << _("l.at(0).") << (QStringList() - << QLatin1String("Tupple") - << QLatin1String("a") - << QLatin1String("b")); + ) << _("l.at(0).") << QStringList({ "Tupple", "a", "b" }); QTest::newRow("template_3") << _( "template \n" @@ -570,10 +540,7 @@ void CppToolsPlugin::test_completion_data() " List l;\n" " @\n" "}" - ) << _("l.t.") << (QStringList() - << QLatin1String("Tupple") - << QLatin1String("a") - << QLatin1String("b")); + ) << _("l.t.") << QStringList({ "Tupple", "a", "b" }); QTest::newRow("template_4") << _( "template \n" @@ -589,10 +556,7 @@ void CppToolsPlugin::test_completion_data() " List l;\n" " @\n" "}" - ) << _("l.u.") << (QStringList() - << QLatin1String("Tupple") - << QLatin1String("a") - << QLatin1String("b")); + ) << _("l.u.") << QStringList({ "Tupple", "a", "b" }); QTest::newRow("template_5") << _( "template \n" @@ -608,10 +572,7 @@ void CppToolsPlugin::test_completion_data() " LT l;" " @\n" "}" - ) << _("l.u.") << (QStringList() - << QLatin1String("Tupple") - << QLatin1String("a") - << QLatin1String("b")); + ) << _("l.u.") << QStringList({ "Tupple", "a", "b" }); QTest::newRow("template_6") << _( "class Item\n" @@ -631,9 +592,7 @@ void CppToolsPlugin::test_completion_data() "{};\n" "ItemContainer container;\n" "@\n" - ) << _("container.get().") << (QStringList() - << QLatin1String("Item") - << QLatin1String("i")); + ) << _("container.get().") << QStringList({ "Item", "i" }); QTest::newRow("template_7") << _( "struct Test\n" @@ -656,9 +615,7 @@ void CppToolsPlugin::test_completion_data() "\n" "TemplateClass p(new Test);\n" "@\n" - ) << _("p->") << (QStringList() - << QLatin1String("Test") - << QLatin1String("i")); + ) << _("p->") << QStringList({ "Test", "i" }); QTest::newRow("type_of_pointer_is_typedef") << _( "typedef struct Foo\n" @@ -667,9 +624,7 @@ void CppToolsPlugin::test_completion_data() "} Foo;\n" "Foo *bar;\n" "@\n" - ) << _("bar->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("foo")); + ) << _("bar->") << QStringList({ "Foo", "foo" }); QTest::newRow("instantiate_full_specialization") << _( "template\n" @@ -686,9 +641,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Template templateChar;\n" "@\n" - ) << _("templateChar.") << (QStringList() - << QLatin1String("Template") - << QLatin1String("templateChar_i")); + ) << _("templateChar.") << QStringList({ "Template", "templateChar_i" }); QTest::newRow("template_as_base: base as template directly") << _( "class Data { int dataMember; };\n" @@ -698,11 +651,7 @@ void CppToolsPlugin::test_completion_data() " Other c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Other") - << QLatin1String("otherMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember" }); QTest::newRow("template_as_base: base as class template") << _( "class Data { int dataMember; };\n" @@ -713,13 +662,8 @@ void CppToolsPlugin::test_completion_data() " More c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Other") - << QLatin1String("otherMember") - << QLatin1String("More") - << QLatin1String("moreMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More", + "moreMember" }); QTest::newRow("template_as_base: base as globally qualified class template") << _( "class Data { int dataMember; };\n" @@ -730,13 +674,8 @@ void CppToolsPlugin::test_completion_data() " More c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Other") - << QLatin1String("otherMember") - << QLatin1String("More") - << QLatin1String("moreMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More", + "moreMember" }); QTest::newRow("template_as_base: base as namespace qualified class template") << _( "class Data { int dataMember; };\n" @@ -749,13 +688,8 @@ void CppToolsPlugin::test_completion_data() " More c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Other") - << QLatin1String("otherMember") - << QLatin1String("More") - << QLatin1String("moreMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More", + "moreMember" }); QTest::newRow("template_as_base: base as nested template name") << _( "class Data { int dataMember; };\n" @@ -768,11 +702,7 @@ void CppToolsPlugin::test_completion_data() " Final c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Final") - << QLatin1String("finalMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember" }); QTest::newRow("template_as_base: base as nested template name in non-template") << _( "class Data { int dataMember; };\n" @@ -785,11 +715,7 @@ void CppToolsPlugin::test_completion_data() " Final c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Final") - << QLatin1String("finalMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember" }); QTest::newRow("template_as_base: base as template name in non-template") << _( "class Data { int dataMember; };\n" @@ -802,13 +728,8 @@ void CppToolsPlugin::test_completion_data() " Final c;\n" " @\n" "}" - ) << _("c.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember") - << QLatin1String("Final") - << QLatin1String("finalMember") - << QLatin1String("Other") - << QLatin1String("otherMember")); + ) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember", "Other", + "otherMember" }); QTest::newRow("template_as_base: typedef not available in derived") << _( "class Data { int dataMember; };\n" @@ -834,9 +755,7 @@ void CppToolsPlugin::test_completion_data() " Derived d;\n" " @\n" "}\n" - ) << _("d.f.") << (QStringList() - << QLatin1String("Data") - << QLatin1String("dataMember")); + ) << _("d.f.") << QStringList({ "Data", "dataMember" }); QTest::newRow("use_global_identifier_as_base_class: derived as global and base as global") << _( "struct Global\n" @@ -851,11 +770,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Final c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_global") - << QLatin1String("int_final") - << QLatin1String("Final") - << QLatin1String("Global")); + ) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" }); QTest::newRow("use_global_identifier_as_base_class: derived is inside namespace. " "base as global") << _( @@ -874,11 +789,7 @@ void CppToolsPlugin::test_completion_data() "\n" "NS::Final c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_global") - << QLatin1String("int_final") - << QLatin1String("Final") - << QLatin1String("Global")); + ) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" }); QTest::newRow("use_global_identifier_as_base_class: derived is enclosed by template. " "base as global") << _( @@ -898,11 +809,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Enclosing::Final c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_global") - << QLatin1String("int_final") - << QLatin1String("Final") - << QLatin1String("Global")); + ) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class") << _( "struct A : A\n" @@ -912,9 +819,7 @@ void CppToolsPlugin::test_completion_data() "\n" "A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. " "class is in namespace") << _( @@ -928,9 +833,7 @@ void CppToolsPlugin::test_completion_data() "\n" "NS::A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. " "class is in namespace. use scope operator for base class") << _( @@ -944,9 +847,7 @@ void CppToolsPlugin::test_completion_data() "\n" "NS::A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as " "derived but in different namespace") << _( @@ -967,10 +868,7 @@ void CppToolsPlugin::test_completion_data() "\n" "NS2::A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_ns1_a") - << QLatin1String("int_ns2_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_ns1_a", "int_ns2_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as " "derived (in namespace) but is nested by different class") << _( @@ -991,10 +889,7 @@ void CppToolsPlugin::test_completion_data() "\n" "NS2::A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_enclosing_a") - << QLatin1String("int_ns2_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_enclosing_a", "int_ns2_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as " "derived (nested) but is nested by different class") << _( @@ -1015,10 +910,7 @@ void CppToolsPlugin::test_completion_data() "\n" "EnclosingDerived::A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_enclosing_base_a") - << QLatin1String("int_enclosing_derived_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_enclosing_base_a", "int_enclosing_derived_a", "A" }); QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. " "class is a template") << _( @@ -1030,9 +922,7 @@ void CppToolsPlugin::test_completion_data() "\n" "A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("int_a") - << QLatin1String("A")); + ) << _("c.") << QStringList({ "int_a", "A" }); QTest::newRow("cyclic_inheritance: direct cyclic inheritance") << _( "struct B;\n" @@ -1041,11 +931,7 @@ void CppToolsPlugin::test_completion_data() "\n" "A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("A") - << QLatin1String("_a") - << QLatin1String("B") - << QLatin1String("_b")); + ) << _("c.") << QStringList({ "A", "_a", "B", "_b" }); QTest::newRow("cyclic_inheritance: indirect cyclic inheritance") << _( "struct C;\n" @@ -1055,13 +941,7 @@ void CppToolsPlugin::test_completion_data() "\n" "A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("A") - << QLatin1String("_a") - << QLatin1String("B") - << QLatin1String("_b") - << QLatin1String("C") - << QLatin1String("_c")); + ) << _("c.") << QStringList({ "A", "_a", "B", "_b", "C", "_c" }); QTest::newRow("cyclic_inheritance: indirect cyclic inheritance") << _( "struct B;\n" @@ -1071,13 +951,7 @@ void CppToolsPlugin::test_completion_data() "\n" "A c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("A") - << QLatin1String("_a") - << QLatin1String("B") - << QLatin1String("_b") - << QLatin1String("C") - << QLatin1String("_c")); + ) << _("c.") << QStringList({ "A", "_a", "B", "_b", "C", "_c" }); QTest::newRow("cyclic_inheritance: direct cyclic inheritance with templates") << _( "template< typename T > struct C;\n" @@ -1093,12 +967,7 @@ void CppToolsPlugin::test_completion_data() "\n" "D c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("D") - << QLatin1String("_d_t") - << QLatin1String("_d_s") - << QLatin1String("C") - << QLatin1String("_c_t")); + ) << _("c.") << QStringList({ "D", "_d_t", "_d_s", "C", "_c_t" }); QTest::newRow("cyclic_inheritance: indirect cyclic inheritance with templates") << _( "template< typename T > struct C;\n" @@ -1118,14 +987,7 @@ void CppToolsPlugin::test_completion_data() "\n" "D c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("D") - << QLatin1String("_d_t") - << QLatin1String("_d_s") - << QLatin1String("C") - << QLatin1String("_c_t") - << QLatin1String("B") - << QLatin1String("_b_t")); + ) << _("c.") << QStringList({ "D", "_d_t", "_d_s", "C", "_c_t", "B", "_b_t" }); QTest::newRow("cyclic_inheritance: direct cyclic inheritance with templates. " "more complex situation") << _( @@ -1156,12 +1018,8 @@ void CppToolsPlugin::test_completion_data() "\n" "Class c;\n" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("Class") - << QLatin1String("ClassRecurse") - << QLatin1String("class_t") - << QLatin1String("class_recurse_s") - << QLatin1String("class_recurse_t")); + ) << _("c.") << QStringList({ "Class", "ClassRecurse", "class_t", "class_recurse_s", + "class_recurse_t" }); QTest::newRow("enclosing_template_class: nested class with enclosing template class") << _( "template\n" @@ -1173,9 +1031,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Enclosing::Nested c;" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("Nested") - << QLatin1String("int_nested")); + ) << _("c.") << QStringList({ "Nested", "int_nested" }); QTest::newRow("enclosing_template_class: nested template class with enclosing template " "class") << _( @@ -1188,9 +1044,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Enclosing::Nested c;" "@\n" - ) << _("c.") << (QStringList() - << QLatin1String("Nested") - << QLatin1String("int_nested")); + ) << _("c.") << QStringList({ "Nested", "int_nested" }); QTest::newRow("instantiate_nested_class_when_enclosing_is_template") << _( "struct Foo \n" @@ -1211,9 +1065,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Enclosing enclosing;\n" "@\n" - ) << _("enclosing.nested.nested_t.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("foo_i")); + ) << _("enclosing.nested.nested_t.") << QStringList({ "Foo", "foo_i" }); QTest::newRow("instantiate_nested_of_nested_class_when_enclosing_is_template") << _( "struct Foo \n" @@ -1238,9 +1090,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Enclosing enclosing;\n" "@\n" - ) << _("enclosing.nested.nestedNested.nestedNested_t.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("foo_i")); + ) << _("enclosing.nested.nestedNested.nestedNested_t.") << QStringList({ "Foo", "foo_i" }); QTest::newRow("instantiate_template_with_default_argument_type") << _( "struct Foo\n" @@ -1256,9 +1106,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Template<> templateWithDefaultTypeOfArgument;\n" "@\n" - ) << _("templateWithDefaultTypeOfArgument.t.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("templateWithDefaultTypeOfArgument.t.") << QStringList({ "Foo", "bar" }); QTest::newRow("instantiate_template_with_default_argument_type_as_template") << _( "struct Foo\n" @@ -1279,9 +1127,7 @@ void CppToolsPlugin::test_completion_data() "\n" "Template templateWithDefaultTypeOfArgument;\n" "@\n" - ) << _("templateWithDefaultTypeOfArgument.s.t.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("templateWithDefaultTypeOfArgument.s.t.") << QStringList({ "Foo", "bar" }); QTest::newRow("typedef_of_pointer") << _( "struct Foo { int bar; };\n" @@ -1291,9 +1137,7 @@ void CppToolsPlugin::test_completion_data() " FooPtr ptr;\n" " @\n" "}" - ) << _("ptr->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("ptr->") << QStringList({ "Foo", "bar" }); QTest::newRow("typedef_of_pointer_inside_function") << _( "struct Foo { int bar; };\n" @@ -1303,9 +1147,7 @@ void CppToolsPlugin::test_completion_data() " FooPtr ptr;\n" " @\n" "}" - ) << _("ptr->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("ptr->") << QStringList({ "Foo", "bar" }); QTest::newRow("typedef_is_inside_function_before_declaration_block") << _( "struct Foo { int bar; };\n" @@ -1317,9 +1159,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }" "}" - ) << _("ptr->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("ptr->") << QStringList({ "Foo", "bar" }); QTest::newRow("resolve_complex_typedef_with_template") << _( "template \n" @@ -1342,10 +1182,7 @@ void CppToolsPlugin::test_completion_data() " Template2 template2;\n" " @\n" "}\n" - ) << _("template2.templateTypedef.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar") - << QLatin1String("Template1")); + ) << _("template2.templateTypedef.") << QStringList({ "Foo", "bar", "Template1" }); QTest::newRow("template_specialization_with_pointer") << _( "template \n" @@ -1360,9 +1197,7 @@ void CppToolsPlugin::test_completion_data() "};\n" "Template templ;\n" "@\n" - ) << _("templ.") << (QStringList() - << QLatin1String("Template") - << QLatin1String("pointer")); + ) << _("templ.") << QStringList({ "Template", "pointer" }); QTest::newRow("typedef_using_templates1") << _( "namespace NS1\n" @@ -1395,9 +1230,7 @@ void CppToolsPlugin::test_completion_data() " NS2::NS2Struct s;\n" " @\n" "}\n" - ) << _("s.p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("s.p->") << QStringList({ "Foo", "bar" }); QTest::newRow("typedef_using_templates2") << _( "namespace NS1\n" @@ -1430,9 +1263,7 @@ void CppToolsPlugin::test_completion_data() " NS2::NS2Struct::pointer p;\n" " @\n" "}\n" - ) << _("p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("p->") << QStringList({ "Foo", "bar" }); QTest::newRow("namespace_alias_with_many_namespace_declarations") << _( "namespace NS1\n" @@ -1460,9 +1291,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("NS::") << (QStringList() - << QLatin1String("Foo1") - << QLatin1String("Foo2")); + ) << _("NS::") << QStringList({ "Foo1", "Foo2" }); QTest::newRow("QTCREATORBUG9098") << _( "template \n" @@ -1481,9 +1310,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "};\n" - ) << _("b.") << (QStringList() - << QLatin1String("c") - << QLatin1String("B")); + ) << _("b.") << QStringList({ "c", "B" }); QTest::newRow("type_and_using_declaration: type and using declaration inside function") << _( "namespace NS\n" @@ -1496,9 +1323,7 @@ void CppToolsPlugin::test_completion_data() " C c;\n" " @\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("type_and_using_declaration: type and using declaration in global " "namespace") << _( @@ -1512,9 +1337,7 @@ void CppToolsPlugin::test_completion_data() " C c;\n" " @\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("type_and_using_declaration: type in global namespace and using declaration in " "NS namespace") << _( @@ -1528,9 +1351,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("type_and_using_declaration: type in global namespace and using declaration " "inside function in NS namespace") << _( @@ -1544,9 +1365,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("type_and_using_declaration: type inside namespace NS1 and using declaration in " "function inside NS2 namespace") << _( @@ -1563,9 +1382,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("type_and_using_declaration: type inside namespace NS1 and using declaration " "inside NS2 namespace") << _( @@ -1582,9 +1399,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("instantiate_template_with_anonymous_class") << _( "template \n" @@ -1597,10 +1412,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.") << (QStringList() - << QLatin1String("S") - << QLatin1String("i") - << QLatin1String("c")); + ) << _("s.") << QStringList({ "S", "i", "c" }); QTest::newRow("instantiate_template_function") << _( "template \n" @@ -1610,9 +1422,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("templateFunction()->") << (QStringList() - << QLatin1String("A") - << QLatin1String("a")); + ) << _("templateFunction()->") << QStringList({ "A", "a" }); QTest::newRow("nested_named_class_declaration_inside_function") << _( "int foo()\n" @@ -1623,9 +1433,7 @@ void CppToolsPlugin::test_completion_data() " } n;\n" " @;\n" "}\n" - ) << _("n.") << (QStringList() - << QLatin1String("Nested") - << QLatin1String("i")); + ) << _("n.") << QStringList({ "Nested", "i" }); QTest::newRow("nested_class_inside_member_function") << _( "struct User { void use(); };\n" @@ -1635,9 +1443,7 @@ void CppToolsPlugin::test_completion_data() " Foo foo;\n" " @\n" "}\n" - ) << _("foo.") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("foo.") << QStringList({ "Foo", "bar" }); QTest::newRow("nested_typedef_inside_member_function") << _( "struct User { void use(); };\n" @@ -1655,10 +1461,7 @@ void CppToolsPlugin::test_completion_data() " MyFoo::Ptr myfoo;\n" " @\n" "}\n" - ) << _("myfoo->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("Ptr") - << QLatin1String("bar")); + ) << _("myfoo->") << QStringList({ "Foo", "Ptr", "bar" }); QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_1") << _( "struct EnclosingStruct\n" @@ -1673,9 +1476,8 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "};\n" - ) << _("member") << (QStringList() - << QLatin1String("memberNestedAnonymousClass") - << QLatin1String("memberOfEnclosingStruct")); + ) << _("member") << QStringList({ "memberNestedAnonymousClass", + "memberOfEnclosingStruct" }); QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_2") << _( "struct EnclosingStruct\n" @@ -1694,10 +1496,9 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "};\n" - ) << _("member") << (QStringList() - << QLatin1String("memberOfNestedAnonymousClass") - << QLatin1String("memberOfNestedOfNestedAnonymousClass") - << QLatin1String("memberOfEnclosingStruct")); + ) << _("member") << QStringList({ "memberOfNestedAnonymousClass", + "memberOfNestedOfNestedAnonymousClass", + "memberOfEnclosingStruct" }); QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_3") << _( "struct EnclosingStruct\n" @@ -1716,8 +1517,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "};\n" - ) << _("nestedOfNestedAnonymousClass.") << (QStringList() - << QLatin1String("memberOfNestedOfNestedAnonymousClass")); + ) << _("nestedOfNestedAnonymousClass.") << QStringList("memberOfNestedOfNestedAnonymousClass"); QTest::newRow("nested_anonymous_class_inside_function") << _( "void fun()\n" @@ -1729,9 +1529,7 @@ void CppToolsPlugin::test_completion_data() " };\n" " @\n" "}\n" - ) << _("foo") << (QStringList() - << QLatin1String("foo1") - << QLatin1String("foo2")); + ) << _("foo") << QStringList({ "foo1", "foo2" }); QTest::newRow("crash_cloning_template_class_QTCREATORBUG9329") << _( "struct A {};\n" @@ -1744,11 +1542,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "};\n" - ) << _("this->") << (QStringList() - << QLatin1String("A") - << QLatin1String("B") - << QLatin1String("Templ") - << QLatin1String("f")); + ) << _("this->") << QStringList({ "A", "B", "Templ", "f" }); QTest::newRow("recursive_auto_declarations1_QTCREATORBUG9503") << _( "void f()\n" @@ -1757,7 +1551,7 @@ void CppToolsPlugin::test_completion_data() " auto object1 = object2;\n" " @;\n" "}\n" - ) << _("object1.") << (QStringList()); + ) << _("object1.") << QStringList(); QTest::newRow("recursive_auto_declarations2_QTCREATORBUG9503") << _( "void f()\n" @@ -1767,7 +1561,7 @@ void CppToolsPlugin::test_completion_data() " auto object1 = object2;\n" " @;\n" "}\n" - ) << _("object1.") << (QStringList()); + ) << _("object1.") << QStringList(); QTest::newRow("recursive_typedefs_declarations1") << _( "void f()\n" @@ -1777,7 +1571,7 @@ void CppToolsPlugin::test_completion_data() " A a;\n" " @;\n" "}\n" - ) << _("a.") << (QStringList()); + ) << _("a.") << QStringList(); QTest::newRow("recursive_typedefs_declarations2") << _( "void f()\n" @@ -1788,7 +1582,7 @@ void CppToolsPlugin::test_completion_data() " A a;\n" " @;\n" "}\n" - ) << _("a.") << (QStringList()); + ) << _("a.") << QStringList(); QTest::newRow("recursive_using_declarations1") << _( "void f()\n" @@ -1798,7 +1592,7 @@ void CppToolsPlugin::test_completion_data() " A a;\n" " @;\n" "}\n" - ) << _("a.") << (QStringList()); + ) << _("a.") << QStringList(); QTest::newRow("recursive_using_declarations2") << _( "void f()\n" @@ -1809,7 +1603,7 @@ void CppToolsPlugin::test_completion_data() " A a;\n" " @;\n" "}\n" - ) << _("a.") << (QStringList()); + ) << _("a.") << QStringList(); QTest::newRow("recursive_using_typedef_declarations") << _( "void f()\n" @@ -1819,7 +1613,7 @@ void CppToolsPlugin::test_completion_data() " A a;\n" " @;\n" "}\n" - ) << _("a.") << (QStringList()); + ) << _("a.") << QStringList(); QTest::newRow("recursive_typedefs_in_templates1") << _( "template\n" @@ -1842,7 +1636,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @;\n" "}\n" - ) << _("cast_retty::ret_type.") << (QStringList()); + ) << _("cast_retty::ret_type.") << QStringList(); QTest::newRow("recursive_typedefs_in_templates2") << _( "template\n" @@ -1854,7 +1648,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @;\n" "}\n" - ) << _("recursive::ret_type.foo") << (QStringList()); + ) << _("recursive::ret_type.foo") << QStringList(); QTest::newRow("class_declaration_inside_function_or_block_QTCREATORBUG3620: " "class definition inside function") << _( @@ -1864,9 +1658,7 @@ void CppToolsPlugin::test_completion_data() " C c;\n" " @\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("class_declaration_inside_function_or_block_QTCREATORBUG3620: " "class definition inside block inside function") << _( @@ -1878,9 +1670,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("class_declaration_inside_function_or_block_QTCREATORBUG3620: " "class definition with the same name inside different block inside function") << _( @@ -1895,9 +1685,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m2")); + ) << _("c.") << QStringList({ "C", "m2" }); QTest::newRow("namespace_alias_inside_function_or_block_QTCREATORBUG166: " "namespace alias inside function") << _( @@ -1917,9 +1705,7 @@ void CppToolsPlugin::test_completion_data() " NS::C c;\n" " @\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("namespace_alias_inside_function_or_block_QTCREATORBUG166: " "namespace alias inside block inside function") << _( @@ -1941,9 +1727,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("c.") << (QStringList() - << QLatin1String("C") - << QLatin1String("m")); + ) << _("c.") << QStringList({ "C", "m" }); QTest::newRow("class_declaration_inside_function_or_block_QTCREATORBUG3620_static_member") << _( "void foo()\n" @@ -1956,10 +1740,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("C::") << (QStringList() - << QLatin1String("C") - << QLatin1String("staticFun2") - << QLatin1String("m2")); + ) << _("C::") << QStringList({ "C", "staticFun2", "m2" }); enumTestCase( "enum_inside_block_inside_function", @@ -2060,9 +1841,7 @@ void CppToolsPlugin::test_completion_data() "};\n" "Enclosing e;\n" "@\n" - ) << _("e.") << (QStringList() - << QLatin1String("Enclosing") - << QLatin1String("i")); + ) << _("e.") << QStringList({ "Enclosing", "i" }); QTest::newRow("lambdaCalls_1") << _( "struct S { int bar; };\n" @@ -2070,9 +1849,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("[](){ return new S; } ()->") << (QStringList() - << QLatin1String("S") - << QLatin1String("bar")); + ) << _("[](){ return new S; } ()->") << QStringList({ "S", "bar" }); QTest::newRow("lambdaCalls_2") << _( "struct S { int bar; };\n" @@ -2080,9 +1857,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("[] { return new S; } ()->") << (QStringList() - << QLatin1String("S") - << QLatin1String("bar")); + ) << _("[] { return new S; } ()->") << QStringList({ "S", "bar" }); QTest::newRow("lambdaCalls_3") << _( "struct S { int bar; };\n" @@ -2090,9 +1865,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("[]() ->S* { return new S; } ()->") << (QStringList() - << QLatin1String("S") - << QLatin1String("bar")); + ) << _("[]() ->S* { return new S; } ()->") << QStringList({ "S", "bar" }); QTest::newRow("lambdaCalls_4") << _( "struct S { int bar; };\n" @@ -2100,9 +1873,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("[]() throw() { return new S; } ()->") << (QStringList() - << QLatin1String("S") - << QLatin1String("bar")); + ) << _("[]() throw() { return new S; } ()->") << QStringList({ "S", "bar" }); QTest::newRow("lambdaCalls_5") << _( "struct S { int bar; };\n" @@ -2110,9 +1881,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("[]() throw()->S* { return new S; } ()->") << (QStringList() - << QLatin1String("S") - << QLatin1String("bar")); + ) << _("[]() throw()->S* { return new S; } ()->") << QStringList({ "S", "bar" }); QTest::newRow("local_type_and_member_1") << _( "struct OtherType { int otherTypeMember; };\n" @@ -2126,9 +1895,7 @@ void CppToolsPlugin::test_completion_data() " LocalType lt;\n" " @\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("local_type_and_member_2") << _( "void foo()\n" @@ -2142,9 +1909,7 @@ void CppToolsPlugin::test_completion_data() " LocalType lt;\n" " @\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("local_type_and_member_3") << _( "void foo()\n" @@ -2160,9 +1925,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("local_type_and_member_4") << _( "namespace NS {struct OtherType { int otherTypeMember; };}\n" @@ -2176,9 +1939,7 @@ void CppToolsPlugin::test_completion_data() " LocalType lt;\n" " @\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("local_type_and_member_5") << _( "namespace NS {struct OtherType { int otherTypeMember; };}\n" @@ -2193,9 +1954,7 @@ void CppToolsPlugin::test_completion_data() " LocalType lt;\n" " @\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("local_type_and_member_6") << _( "namespace NS {struct OtherType { int otherTypeMember; };}\n" @@ -2210,9 +1969,7 @@ void CppToolsPlugin::test_completion_data() " LocalType lt;\n" " @\n" "}\n" - ) << _("lt.ot.") << (QStringList() - << QLatin1String("OtherType") - << QLatin1String("otherTypeMember")); + ) << _("lt.ot.") << QStringList({ "OtherType", "otherTypeMember" }); QTest::newRow("template_parameter_defined_inside_scope_of_declaration_QTCREATORBUG9169_1") << _( "struct A\n" @@ -2241,9 +1998,7 @@ void CppToolsPlugin::test_completion_data() " Template templ;\n" " @\n" "}\n" - ) << _("templ.get()->") << (QStringList() - << QLatin1String("B") - << QLatin1String("b")); + ) << _("templ.get()->") << QStringList({ "B", "b" }); QTest::newRow("template_parameter_defined_inside_scope_of_declaration_QTCREATORBUG9169_2") << _( "struct A\n" @@ -2272,9 +2027,7 @@ void CppToolsPlugin::test_completion_data() " Template templ;\n" " @\n" "}\n" - ) << _("templ.t.") << (QStringList() - << QLatin1String("B") - << QLatin1String("b")); + ) << _("templ.t.") << QStringList({ "B", "b" }); QTest::newRow("template_parameter_defined_inside_scope_of_declaration_QTCREATORBUG8852_1") << _( "template \n" @@ -2291,9 +2044,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("list.at(0).") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("list.at(0).") << QStringList({ "Foo", "bar" }); QTest::newRow("template_parameter_defined_inside_scope_of_declaration_QTCREATORBUG8852_2") << _( "template \n" @@ -2313,9 +2064,7 @@ void CppToolsPlugin::test_completion_data() " }\n" " }\n" "}\n" - ) << _("list.at(0).") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("list.at(0).") << QStringList({ "Foo", "bar" }); QTest::newRow("template_parameter_defined_inside_scope_of_declaration_QTCREATORBUG8852_3") << _( "template \n" @@ -2333,9 +2082,7 @@ void CppToolsPlugin::test_completion_data() " QList list;\n" " @\n" "}\n" - ) << _("list.at(0).") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("list.at(0).") << QStringList({ "Foo", "bar" }); const QByteArray commonSignalSlotCompletionTestCode = "#define SIGNAL(a) #a\n" @@ -2386,67 +2133,43 @@ void CppToolsPlugin::test_completion_data() QTest::newRow("SIGNAL(") << commonSignalSlotCompletionTestCode - << _("connect(myObject, SIGNAL(") << (QStringList() - << QLatin1String("baseSignal1()") - << QLatin1String("baseSignal2(int)") - << QLatin1String("hiddenSignal()") - << QLatin1String("derivedSignal1()") - << QLatin1String("derivedSignal2(int)")); + << _("connect(myObject, SIGNAL(") << QStringList({ "baseSignal1()", "baseSignal2(int)", + "hiddenSignal()", "derivedSignal1()", + "derivedSignal2(int)" }); QTest::newRow("SLOT(") << commonSignalSlotCompletionTestCode - << _("connect(myObject, SIGNAL(baseSignal1()), myObject, SLOT(") << (QStringList() - << QLatin1String("baseSlot1()") - << QLatin1String("baseSlot2(int)") - << QLatin1String("derivedSlot1()") - << QLatin1String("derivedSlot2(int)")); + << _("connect(myObject, SIGNAL(baseSignal1()), myObject, SLOT(") + << QStringList({ "baseSlot1()", "baseSlot2(int)", "derivedSlot1()", "derivedSlot2(int)" }); QTest::newRow("Qt5 signals: complete class after & at 2nd connect arg") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &") << (QStringList() - << QLatin1String("N::Derived")); + << _("connect(myObject, &") << QStringList("N::Derived"); QTest::newRow("Qt5 signals: complete class after & at 4th connect arg") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &MyObject::timeout, myObject, &") << (QStringList() - << QLatin1String("N::Derived")); + << _("connect(myObject, &MyObject::timeout, myObject, &") << QStringList("N::Derived"); QTest::newRow("Qt5 signals: complete signals") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &N::Derived::") << (QStringList() - << QLatin1String("baseSignal1") - << QLatin1String("baseSignal2") - << QLatin1String("hiddenSignal") - << QLatin1String("derivedSignal1") - << QLatin1String("derivedSignal2")); + << _("connect(myObject, &N::Derived::") + << QStringList({ "baseSignal1", "baseSignal2", "hiddenSignal", "derivedSignal1", + "derivedSignal2" }); QTest::newRow("Qt5 slots") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &N::Derived, myObject, &N::Derived::") << (QStringList() - << QLatin1String("baseFunction") - << QLatin1String("baseSignal1") - << QLatin1String("baseSignal2") - << QLatin1String("baseSlot1") - << QLatin1String("baseSlot2") - << QLatin1String("derivedFunction") - << QLatin1String("derivedSignal1") - << QLatin1String("derivedSignal2") - << QLatin1String("derivedSlot1") - << QLatin1String("derivedSlot2") - << QLatin1String("hiddenFunction") - << QLatin1String("hiddenSignal")); + << _("connect(myObject, &N::Derived, myObject, &N::Derived::") + << QStringList({ "baseFunction", "baseSignal1", "baseSignal2", "baseSlot1", "baseSlot2", + "derivedFunction", "derivedSignal1", "derivedSignal2", "derivedSlot1", + "derivedSlot2", "hiddenFunction", "hiddenSignal" }); QTest::newRow("Qt5 signals: fallback to scope completion") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &N::") << (QStringList() - << QLatin1String("Base") - << QLatin1String("Derived")); + << _("connect(myObject, &N::") << QStringList({ "Base", "Derived" }); QTest::newRow("Qt5 slots: fallback to scope completion") << commonSignalSlotCompletionTestCode - << _("connect(myObject, &N::Derived, myObject, &N::") << (QStringList() - << QLatin1String("Base") - << QLatin1String("Derived")); + << _("connect(myObject, &N::Derived, myObject, &N::") << QStringList({ "Base", "Derived" }); QTest::newRow("signals_hide_QPrivateSignal") << _( "#define SIGNAL(a) #a\n" @@ -2472,8 +2195,7 @@ void CppToolsPlugin::test_completion_data() " Timer *timer = new Timer;\n" " @\n" "}\n" - ) << _("connect(timer, SIGNAL(") << (QStringList() - << QLatin1String("timeout()")); + ) << _("connect(timer, SIGNAL(") << QStringList("timeout()"); QTest::newRow("member_of_class_accessed_by_using_QTCREATORBUG9037_1") << _( "namespace NS { struct S { int member; void fun(); }; }\n" @@ -2482,8 +2204,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("mem") << (QStringList() - << QLatin1String("member")); + ) << _("mem") << QStringList("member"); QTest::newRow("member_of_class_accessed_by_using_QTCREATORBUG9037_2") << _( "namespace NS \n" @@ -2499,8 +2220,7 @@ void CppToolsPlugin::test_completion_data() "{\n" " @\n" "}\n" - ) << _("mem") << (QStringList() - << QLatin1String("member")); + ) << _("mem") << QStringList("member"); QTest::newRow("no_binding_block_as_instantiationOrigin_QTCREATORBUG-11424") << _( "template \n" @@ -2516,7 +2236,7 @@ void CppToolsPlugin::test_completion_data() " typedef QVector::ConstIterator Iter;\n" " @\n" "}\n" - ) << _("double val = d.constBegin()->") << (QStringList()); + ) << _("double val = d.constBegin()->") << QStringList(); QTest::newRow("nested_class_in_template_class_QTCREATORBUG-11752") << _( "template \n" @@ -2530,9 +2250,7 @@ void CppToolsPlugin::test_completion_data() " Temp::Nested2 n2;\n" " @\n" "}\n" - ) << _("n2.n1.t.") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("n2.n1.t.") << QStringList({ "foo", "Foo" }); QTest::newRow("infiniteLoopLocalTypedef_QTCREATORBUG-11999") << _( "template \n" @@ -2550,14 +2268,11 @@ void CppToolsPlugin::test_completion_data() " Temp tempFoo;\n" " @\n" "}\n" - ) << _("tempFoo.nested.t.") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("tempFoo.nested.t.") << QStringList({ "foo", "Foo" }); QTest::newRow("lambda_parameter") << _( "auto func = [](int arg1) { return @; };\n" - ) << _("ar") << (QStringList() - << QLatin1String("arg1")); + ) << _("ar") << QStringList("arg1"); QTest::newRow("default_arguments_for_class_templates_and_base_class_QTCREATORBUG-12605") << _( "struct Foo { int foo; };\n" @@ -2567,10 +2282,7 @@ void CppToolsPlugin::test_completion_data() " Derived<> derived;\n" " @\n" "}\n" - ) << _("derived.") << (QStringList() - << QLatin1String("Derived") - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("derived.") << QStringList({ "Derived", "foo", "Foo" }); QTest::newRow("default_arguments_for_class_templates_and_template_base_class_QTCREATORBUG-12606") << _( "struct Foo { int foo; };\n" @@ -2582,9 +2294,7 @@ void CppToolsPlugin::test_completion_data() " Derived<> derived;\n" " @\n" "}\n" - ) << _("derived.t.") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("derived.t.") << QStringList({ "foo", "Foo" }); QTest::newRow("template_specialization_and_initialization_with_pointer1") << _( "template \n" @@ -2596,9 +2306,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.t->") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("s.t->") << QStringList({ "foo", "Foo" }); // this is not a valid code(is not compile) but it caused a crash QTest::newRow("template_specialization_and_initialization_with_pointer2") << _( @@ -2611,9 +2319,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.t->") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("s.t->") << QStringList({ "foo", "Foo" }); QTest::newRow("typedef_of_pointer_of_array_QTCREATORBUG-12703") << _( "struct Foo { int foo; };\n" @@ -2622,9 +2328,7 @@ void CppToolsPlugin::test_completion_data() " FooArr arr;\n" " @\n" "}\n" - ) << _("arr[0]->") << (QStringList() - << QLatin1String("foo") - << QLatin1String("Foo")); + ) << _("arr[0]->") << QStringList({ "foo", "Foo" }); QTest::newRow("template_specialization_with_array1") << _( "template \n" @@ -2635,9 +2339,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.") << (QStringList() - << QLatin1String("foo") - << QLatin1String("S")); + ) << _("s.") << QStringList({ "foo", "S" }); QTest::newRow("template_specialization_with_array2") << _( "template \n" @@ -2648,9 +2350,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.") << (QStringList() - << QLatin1String("foo") - << QLatin1String("S")); + ) << _("s.") << QStringList({ "foo", "S" }); QTest::newRow("template_specialization_with_array3") << _( "struct Bar {};\n" @@ -2662,8 +2362,7 @@ void CppToolsPlugin::test_completion_data() " S s;\n" " @\n" "}\n" - ) << _("s.") << (QStringList() - << QLatin1String("S")); + ) << _("s.") << QStringList("S"); QTest::newRow("auto_declaration_in_if_condition") << _( "struct Foo { int bar; };\n" @@ -2672,9 +2371,7 @@ void CppToolsPlugin::test_completion_data() " @\n" " }\n" "}\n" - ) << _("s->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("s->") << QStringList({ "Foo", "bar" }); QTest::newRow("dereference_of_nested_type_opertor_*") << _( "template\n" @@ -2692,9 +2389,7 @@ void CppToolsPlugin::test_completion_data() " QList list;\n" " @\n" "}\n" - ) << _("(*list.begin()).") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("(*list.begin()).") << QStringList({ "Foo", "bar" }); QTest::newRow("dereference_of_nested_type_opertor_->") << _( "template\n" @@ -2712,9 +2407,7 @@ void CppToolsPlugin::test_completion_data() " QList list;\n" " @\n" "}\n" - ) << _("list.begin()->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("list.begin()->") << QStringList({ "Foo", "bar" }); QTest::newRow("dereference_of_nested_type_opertor_*_and_auto") << _( "template\n" @@ -2733,9 +2426,7 @@ void CppToolsPlugin::test_completion_data() " auto a = list.begin();\n" " @\n" "}\n" - ) << _("(*a).") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("(*a).") << QStringList({ "Foo", "bar" }); QTest::newRow("dereference_of_nested_type_opertor_->_and_auto") << _( "template\n" @@ -2754,9 +2445,7 @@ void CppToolsPlugin::test_completion_data() " auto a = list.begin();\n" " @\n" "}\n" - ) << _("a->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("a->") << QStringList({ "Foo", "bar" }); QTest::newRow("direct_nested_template_type_access") << _( "template\n" @@ -2774,10 +2463,7 @@ void CppToolsPlugin::test_completion_data() " auto a = QList::begin();\n" " @\n" "}\n" - ) << _("a.") << (QStringList() - << QLatin1String("operator ->") - << QLatin1String("t") - << QLatin1String("iterator")); + ) << _("a.") << QStringList({ "operator ->", "t", "iterator" }); QTest::newRow("pointer_indirect_specialization") << _( "template\n" @@ -2804,9 +2490,7 @@ void CppToolsPlugin::test_completion_data() " Temp t;\n" " @\n" "}\n" - ) << _("t.p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("t.p->") << QStringList({ "Foo", "bar" }); QTest::newRow("pointer_indirect_specialization_typedef") << _( "template\n" @@ -2833,9 +2517,7 @@ void CppToolsPlugin::test_completion_data() " Temp t;\n" " @\n" "}\n" - ) << _("t.p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("t.p->") << QStringList({ "Foo", "bar" }); QTest::newRow("pointer_indirect_specialization_double_indirection") << _( "template\n" @@ -2866,9 +2548,7 @@ void CppToolsPlugin::test_completion_data() " Temp::indirect t;\n" " @\n" "}\n" - ) << _("t.p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("t.p->") << QStringList({ "Foo", "bar" }); QTest::newRow("pointer_indirect_specialization_double_indirection_with_base") << _( "template\n" @@ -2903,9 +2583,7 @@ void CppToolsPlugin::test_completion_data() " Temp::indirect t;\n" " @\n" "}\n" - ) << _("t.p->") << (QStringList() - << QLatin1String("Foo") - << QLatin1String("bar")); + ) << _("t.p->") << QStringList({ "Foo", "bar" }); } void CppToolsPlugin::test_completion_member_access_operator() @@ -2942,9 +2620,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "void f() { S *s;\n" "@\n" "}\n" - ) << _("s.") << (QStringList() - << QLatin1String("S") - << QLatin1String("t")) + ) << _("s.") << QStringList({ "S", "t" }) << false << true; @@ -2954,7 +2630,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() " Bar *bar;\n" " void func() { @ }" "};\n" - ) << _("bar.") << (QStringList()) + ) << _("bar.") << QStringList() << true << false; @@ -2963,9 +2639,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef S SType;\n" "SType p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << false; @@ -2974,7 +2648,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef S *SType;\n" "SType *p;\n" "@\n" - ) << _("p.") << (QStringList()) + ) << _("p.") << QStringList() << false << false; @@ -2983,9 +2657,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef S SType;\n" "SType *p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << true; @@ -2994,9 +2666,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef S* SPtr;\n" "SPtr p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << true; @@ -3005,9 +2675,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "struct S { int m; };\n" "SType *p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << true; @@ -3016,9 +2684,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "struct S { int m; };\n" "SType p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << false; @@ -3027,7 +2693,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "struct S { int m; };\n" "SType *p;\n" "@\n" - ) << _("p.") << (QStringList()) + ) << _("p.") << QStringList() << false << false; @@ -3036,9 +2702,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "struct S { int m; };\n" "SType p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << true; @@ -3048,9 +2712,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef struct SType *STypePtr;\n" "STypePtr p;\n" "@\n" - ) << _("p.") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p.") << QStringList({ "S", "m" }) << false << true; @@ -3060,9 +2722,7 @@ void CppToolsPlugin::test_completion_member_access_operator_data() "typedef struct SType *STypePtr;\n" "STypePtr p;\n" "@\n" - ) << _("p->") << (QStringList() - << QLatin1String("S") - << QLatin1String("m")) + ) << _("p->") << QStringList({ "S", "m" }) << false << false; } diff --git a/src/plugins/cpptools/cppcompletionassistprocessor.cpp b/src/plugins/cpptools/cppcompletionassistprocessor.cpp index d1a1be9baca..5e967455d45 100644 --- a/src/plugins/cpptools/cppcompletionassistprocessor.cpp +++ b/src/plugins/cpptools/cppcompletionassistprocessor.cpp @@ -42,34 +42,14 @@ namespace CppTools { CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder) : m_positionForProposal(-1) - , m_preprocessorCompletions(QStringList() - << QLatin1String("define") - << QLatin1String("error") - << QLatin1String("include") - << QLatin1String("line") - << QLatin1String("pragma") - << QLatin1String("pragma once") - << QLatin1String("pragma omp atomic") - << QLatin1String("pragma omp parallel") - << QLatin1String("pragma omp for") - << QLatin1String("pragma omp ordered") - << QLatin1String("pragma omp parallel for") - << QLatin1String("pragma omp section") - << QLatin1String("pragma omp sections") - << QLatin1String("pragma omp parallel sections") - << QLatin1String("pragma omp single") - << QLatin1String("pragma omp master") - << QLatin1String("pragma omp critical") - << QLatin1String("pragma omp barrier") - << QLatin1String("pragma omp flush") - << QLatin1String("pragma omp threadprivate") - << QLatin1String("undef") - << QLatin1String("if") - << QLatin1String("ifdef") - << QLatin1String("ifndef") - << QLatin1String("elif") - << QLatin1String("else") - << QLatin1String("endif")) + , m_preprocessorCompletions( + QStringList({ "define", "error", "include", "line", "pragma", "pragma once", + "pragma omp atomic", "pragma omp parallel", "pragma omp for", + "pragma omp ordered", "pragma omp parallel for", "pragma omp section", + "pragma omp sections", "pragma omp parallel sections", "pragma omp single", + "pragma omp master", "pragma omp critical", "pragma omp barrier", + "pragma omp flush", "pragma omp threadprivate", "undef", "if", "ifdef", + "ifndef", "elif", "else", "endif" })) , m_hintProposal(0) , m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID), QIcon(QLatin1String(":/texteditor/images/snippet.png")), diff --git a/src/plugins/cpptools/cppfilesettingspage.cpp b/src/plugins/cpptools/cppfilesettingspage.cpp index 4fcc68c6dc6..0c73c44d8da 100644 --- a/src/plugins/cpptools/cppfilesettingspage.cpp +++ b/src/plugins/cpptools/cppfilesettingspage.cpp @@ -87,15 +87,12 @@ void CppFileSettings::toSettings(QSettings *s) const void CppFileSettings::fromSettings(QSettings *s) { - const QStringList defaultHeaderSearchPaths = QStringList() - << QLatin1String("include") - << QLatin1String("Include") - << QDir::toNativeSeparators(QLatin1String("../include")) - << QDir::toNativeSeparators(QLatin1String("../Include")); - const QStringList defaultSourceSearchPaths = QStringList() - << QDir::toNativeSeparators(QLatin1String("../src")) - << QDir::toNativeSeparators(QLatin1String("../Src")) - << QLatin1String(".."); + const QStringList defaultHeaderSearchPaths + = QStringList({ "include", "Include", QDir::toNativeSeparators("../include"), + QDir::toNativeSeparators("../Include") }); + const QStringList defaultSourceSearchPaths + = QStringList({ QDir::toNativeSeparators("../src"), QDir::toNativeSeparators("../Src"), + ".." }); s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP)); headerPrefixes = s->value(QLatin1String(headerPrefixesKeyC)).toStringList(); sourcePrefixes = s->value(QLatin1String(sourcePrefixesKeyC)).toStringList(); diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp index 94e0314d5ab..1468b0e250a 100644 --- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp +++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp @@ -48,10 +48,10 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::IRunConfigurat globalSettingLayout->setContentsMargins(0, 0, 0, 0); m_settingsCombo = new QComboBox(globalSetting); - m_settingsCombo->addItems(QStringList() - << QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Global") - << QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom") - ); + m_settingsCombo->addItems(QStringList({ + QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Global"), + QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom") + })); globalSettingLayout->addWidget(m_settingsCombo); connect(m_settingsCombo, static_cast(&QComboBox::activated), this, &AnalyzerRunConfigWidget::chooseSettings); diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 6ed93164d72..307c8e64439 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -902,9 +902,8 @@ BreakHandler::BreakHandler() #if USE_BREAK_MODEL_TEST new ModelTest(this, 0); #endif - setHeader(QStringList() - << tr("Number") << tr("Function") << tr("File") << tr("Line") - << tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads")); + setHeader(QStringList({ tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"), + tr("Condition"), tr("Ignore"), tr("Threads") })); } static inline bool fileNameMatch(const QString &f1, const QString &f2) diff --git a/src/plugins/designer/gotoslot_test.cpp b/src/plugins/designer/gotoslot_test.cpp index 79e0a159c4c..7b15d186822 100644 --- a/src/plugins/designer/gotoslot_test.cpp +++ b/src/plugins/designer/gotoslot_test.cpp @@ -214,9 +214,8 @@ public: // Since no project is opened and the ui_*.h is not generated, // the following diagnostic messages will be ignored. - const QStringList ignoreList = QStringList() - << QLatin1String("ui_form.h: No such file or directory") - << QLatin1String("QWidget: No such file or directory"); + const QStringList ignoreList = QStringList({ "ui_form.h: No such file or directory", + "QWidget: No such file or directory" }); QList cleanedDiagnosticMessages; foreach (const Document::DiagnosticMessage &message, document->diagnosticMessages()) { if (!ignoreList.contains(message.text())) @@ -247,10 +246,9 @@ void FormEditorPlugin::test_gotoslot_data() MyTestDataDir testDataDirWithoutProject(_("gotoslot_withoutProject")); QTest::newRow("withoutProject") - << (QStringList() - << testDataDirWithoutProject.file(_("form.cpp")) - << testDataDirWithoutProject.file(_("form.h")) - << testDataDirWithoutProject.file(_("form.ui"))); + << QStringList({ testDataDirWithoutProject.file(_("form.cpp")), + testDataDirWithoutProject.file(_("form.h")), + testDataDirWithoutProject.file(_("form.ui")) }); // Finding the right class for inserting definitions/declarations is based on // finding a class with a member whose type is the class from the "ui_xxx.h" header. @@ -261,24 +259,18 @@ void FormEditorPlugin::test_gotoslot_data() testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer")); QTest::newRow("insertIntoCorrectClass_pointer") - << (QStringList() - << testDataDir.file(_("form.cpp")) - << testDataDir.file(_("form.h")) - << testDataDirWithoutProject.file(_("form.ui"))); // reuse + << QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")), + testDataDirWithoutProject.file(_("form.ui")) }); // reuse testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_non-pointer")); QTest::newRow("insertIntoCorrectClass_non-pointer") - << (QStringList() - << testDataDir.file(_("form.cpp")) - << testDataDir.file(_("form.h")) - << testDataDirWithoutProject.file(_("form.ui"))); // reuse + << QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")), + testDataDirWithoutProject.file(_("form.ui")) }); // reuse testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer_ns_using")); QTest::newRow("insertIntoCorrectClass_pointer_ns_using") - << (QStringList() - << testDataDir.file(_("form.cpp")) - << testDataDir.file(_("form.h")) - << testDataDir.file(_("form.ui"))); + << QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")), + testDataDir.file(_("form.ui")) }); } } // namespace Internal diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 4db4d5dcbcb..9a19e0b6ddb 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -353,19 +353,9 @@ static QString addConstRefIfNeeded(const QString &argument) return argument; // for those types we don't want to add "const &" - static const QStringList nonConstRefs = QStringList() - << QLatin1String("bool") - << QLatin1String("int") - << QLatin1String("uint") - << QLatin1String("float") - << QLatin1String("double") - << QLatin1String("long") - << QLatin1String("short") - << QLatin1String("char") - << QLatin1String("signed") - << QLatin1String("unsigned") - << QLatin1String("qint64") - << QLatin1String("quint64"); + static const QStringList nonConstRefs = QStringList({ "bool", "int", "uint", "float", "double", + "long", "short", "char", "signed", + "unsigned", "qint64", "quint64" }); for (int i = 0; i < nonConstRefs.count(); i++) { const QString nonConstRef = nonConstRefs.at(i); diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index a5a2af3cb04..c5b29a0b168 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -387,14 +387,11 @@ QStringList IosDsymBuildStep::defaultCleanCmdList() const { IosRunConfiguration *runConf = qobject_cast(target()->activeRunConfiguration()); - QTC_ASSERT(runConf, return QStringList(QLatin1String("echo"))); + QTC_ASSERT(runConf, return QStringList("echo")); QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(QLatin1String(".dSYM")); - return QStringList() - << QLatin1String("rm") - << QLatin1String("-rf") - << dsymPath; + return QStringList({ "rm", "-rf", dsymPath }); } QStringList IosDsymBuildStep::defaultCmdList() const @@ -410,11 +407,7 @@ QStringList IosDsymBuildStep::defaultCmdList() const QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(QLatin1String(".dSYM")); - return QStringList() - << dsymutilCmd - << QLatin1String("-o") - << dsymPath - << runConf->localExecutable().toUserOutput(); + return QStringList({ dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput() }); } diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index cc3246e41a6..c85ec82873a 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -418,7 +418,7 @@ static FileNameList gatherQmakePathsFromQtChooser() if (qtchooser.isEmpty()) return FileNameList(); - QList versions = runQtChooser(qtchooser, QStringList() << QStringLiteral("-l")); + QList versions = runQtChooser(qtchooser, QStringList("-l")); QSet foundQMakes; foreach (const QByteArray &version, versions) { FileName possibleQMake = FileName::fromString( @@ -475,12 +475,12 @@ static void updateDocumentation() { QStringList files; foreach (BaseQtVersion *v, m_versions) { - const QStringList docPaths = QStringList() << v->documentationPath() + QLatin1Char('/') - << v->documentationPath() + QLatin1String("/qch/"); + const QStringList docPaths = QStringList({ v->documentationPath() + QChar('/'), + v->documentationPath() + "/qch/" }); foreach (const QString &docPath, docPaths) { const QDir versionHelpDir(docPath); foreach (const QString &helpFile, - versionHelpDir.entryList(QStringList() << QLatin1String("*.qch"), QDir::Files)) + versionHelpDir.entryList(QStringList("*.qch"), QDir::Files)) files << docPath + helpFile; } } diff --git a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp index edbb482a489..1c0eeedc8db 100644 --- a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp +++ b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp @@ -362,8 +362,7 @@ private: static void createImageFromDot(const QString &inputFile, const QString &outputFile, bool verbose) { const QString command = CplusplusToolsUtils::portableExecutableName(QLatin1String("dot")); - const QStringList arguments = QStringList() - << QLatin1String("-Tpng") << QLatin1String("-o") << outputFile << inputFile; + const QStringList arguments = QStringList({ "-Tpng", "-o", outputFile, inputFile }); CplusplusToolsUtils::executeCommand(command, arguments, QString(), verbose); } diff --git a/src/tools/qtcreatorcrashhandler/backtracecollector.cpp b/src/tools/qtcreatorcrashhandler/backtracecollector.cpp index 848788e8562..f4c49ba919a 100644 --- a/src/tools/qtcreatorcrashhandler/backtracecollector.cpp +++ b/src/tools/qtcreatorcrashhandler/backtracecollector.cpp @@ -65,12 +65,11 @@ BacktraceCollector::~BacktraceCollector() void BacktraceCollector::run(Q_PID pid) { - d->debugger.start(QLatin1String("gdb"), QStringList() - << QLatin1String("--nw") // Do not use a window interface. - << QLatin1String("--nx") // Do not read .gdbinit file. - << QLatin1String("--batch") // Exit after processing options. - << QLatin1String("--command") << createTemporaryCommandFile() - << QLatin1String("--pid") << QString::number(pid) + d->debugger.start(QLatin1String("gdb"), QStringList({ + "--nw", // Do not use a window interface. + "--nx", // Do not read .gdbinit file. + "--batch", // Exit after processing options. + "--command", createTemporaryCommandFile(), "--pid", QString::number(pid) }) ); } diff --git a/src/tools/qtcreatorcrashhandler/crashhandler.cpp b/src/tools/qtcreatorcrashhandler/crashhandler.cpp index bb61e876e85..0bd212b5613 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandler.cpp +++ b/src/tools/qtcreatorcrashhandler/crashhandler.cpp @@ -302,11 +302,7 @@ void CrashHandler::debugApplication() QString executable = d->creatorInPath.toString(); if (executable.isEmpty() && !d->restartAppCommandLine.isEmpty()) executable = d->restartAppCommandLine.at(0); - const QStringList commandLine = QStringList() - << executable - << QLatin1String("-debug") - << QString::number(d->pid); - + const QStringList commandLine = QStringList({ executable, "-debug", QString::number(d->pid) }); QStringList environment; if (!d->restartAppEnvironment.isEmpty()) environment = d->restartAppEnvironment; diff --git a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp index cdbeb745cfa..37e1c94ea40 100644 --- a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp +++ b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp @@ -118,69 +118,57 @@ void tst_ImportCheck::test_data() QTest::addColumn("paths"); QTest::addColumn("expectedLibraries"); QTest::addColumn("expectedFiles"); - QTest::newRow("base") << QStringList(QLatin1String(TESTSRCDIR "/base")) - << (QStringList() << QLatin1String("QML 1.0") - << QLatin1String("QtQml 2.2") - << QLatin1String("QtQml 2.1") - << QLatin1String("QtQuick 2.0") - << QLatin1String("QtQml 2.0") - << QLatin1String("QtQuick 2.-1") - << QLatin1String("QtQuick 2.1") - << QLatin1String("QtQuick 2.2") - << QLatin1String("")) + QTest::newRow("base") << QStringList(QString(TESTSRCDIR "/base")) + << QStringList({ "QML 1.0", "QtQml 2.2", "QtQml 2.1", "QtQuick 2.0", + "QtQml 2.0", "QtQuick 2.-1", "QtQuick 2.1", + "QtQuick 2.2", "" }) << QStringList(); - QTest::newRow("001_flatQmlOnly") << QStringList(QLatin1String(TESTSRCDIR "/001_flatQmlOnly")) + QTest::newRow("001_flatQmlOnly") << QStringList(QString(TESTSRCDIR "/001_flatQmlOnly")) << QStringList() << QStringList(); - QTest::newRow("002_nestedQmlOnly") << QStringList(QLatin1String(TESTSRCDIR "/002_nestedQmlOnly")) + QTest::newRow("002_nestedQmlOnly") << QStringList(QString(TESTSRCDIR "/002_nestedQmlOnly")) << QStringList() << QStringList(); - /*QTest::newRow("003_packageQmlOnly") << QStringList(QLatin1String(TESTSRCDIR "/003_packageQmlOnly")) - << (QStringList() << QLatin1String("QtGraphicalEffects")) - << (QStringList() - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ZoomBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastGlow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianInnerShadow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/SourceProxy.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/GammaAdjust.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/HueSaturation.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Colorize.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RadialBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ColorOverlay.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/MaskedBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RectangularGlow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Displace.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastMaskedBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Desaturate.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianDirectionalBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/GaussianBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/InnerShadow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/LinearGradient.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Blend.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Glow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RecursiveBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianMaskedBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/DropShadow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/DirectionalBlur.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/OpacityMask.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/BrightnessContrast.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianGlow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RadialGradient.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastInnerShadow.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ConicalGradient.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ThresholdMask.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/LevelAdjust.qml") - << QLatin1String(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/FastBlur.qml")); - QTest::newRow("004_cppOnly copy") << QStringList(QLatin1String(TESTSRCDIR "004_cppOnly copy")) - << (QStringList() << QLatin1String("QML 1.0") - << QLatin1String("QtQml 2.2") - << QLatin1String("QtQml 2.1") - << QLatin1String("QtQuick 2.0") - << QLatin1String("QtQml 2.0") - << QLatin1String("QtQuick 2.-1") - << QLatin1String("QtQuick 2.1") - << QLatin1String("QtQuick 2.2") - << QLatin1String("")) + /*QTest::newRow("003_packageQmlOnly") << QStringList(QString(TESTSRCDIR "/003_packageQmlOnly")) + << QStringList("QtGraphicalEffects") + << QStringList() + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ZoomBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastGlow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianInnerShadow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/SourceProxy.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/GammaAdjust.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/HueSaturation.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Colorize.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RadialBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ColorOverlay.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/MaskedBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RectangularGlow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Displace.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastMaskedBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Desaturate.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianDirectionalBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/GaussianBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/InnerShadow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/LinearGradient.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Blend.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/Glow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RecursiveBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianMaskedBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/DropShadow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/DirectionalBlur.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/OpacityMask.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/BrightnessContrast.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/GaussianGlow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/RadialGradient.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/private/FastInnerShadow.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ConicalGradient.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/ThresholdMask.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/LevelAdjust.qml") + << QString(TESTSRCDIR "/003_packageQmlOnly/QtGraphicalEffects/FastBlur.qml")); + QTest::newRow("004_cppOnly copy") << QStringList(QString(TESTSRCDIR "004_cppOnly copy")) + << QStringList({ "QML 1.0", "QtQml 2.2", "QtQml 2.1", "QtQuick 2.0", + "QtQml 2.0", "QtQuick 2.-1", "QtQuick 2.1", + "QtQuick 2.2", "" }) << QStringList();*/ } diff --git a/tests/auto/qml/qrcparser/tst_qrcparser.cpp b/tests/auto/qml/qrcparser/tst_qrcparser.cpp index 72d425a4e85..d8c3f03c36c 100644 --- a/tests/auto/qml/qrcparser/tst_qrcparser.cpp +++ b/tests/auto/qml/qrcparser/tst_qrcparser.cpp @@ -162,18 +162,10 @@ void tst_QrcParser::simpleTest() QrcParser::Ptr p = QrcParser::parseQrcFile(QString::fromLatin1(TESTSRCDIR).append(QLatin1String("/simple.qrc")), QString()); QStringList paths = allPaths(p); paths.sort(); - QVERIFY(paths == QStringList() - << QLatin1String("/") - << QLatin1String("/cut.jpg") - << QLatin1String("/images/") - << QLatin1String("/images/copy.png") - << QLatin1String("/images/cut.png") - << QLatin1String("/images/new.png") - << QLatin1String("/images/open.png") - << QLatin1String("/images/paste.png") - << QLatin1String("/images/save.png") - << QLatin1String("/myresources/") - << QLatin1String("/myresources/cut-img.png")); + QVERIFY(paths == QStringList({ "/", "/cut.jpg", "/images/", "/images/copy.png", + "/images/cut.png", "/images/new.png", "/images/open.png", + "/images/paste.png", "/images/save.png", "/myresources/", + "/myresources/cut-img.png" })); QString frPath = p->firstFileAtPath(QLatin1String("/cut.jpg"), QLocale(QLatin1String("fr_FR"))); QString refFrPath = QString::fromLatin1(TESTSRCDIR).append(QLatin1String("/cut_fr.jpg")); QCOMPARE(frPath, refFrPath);