diff options
Diffstat (limited to 'tests/auto/tools')
24 files changed, 1796 insertions, 1214 deletions
diff --git a/tests/auto/tools/CMakeLists.txt b/tests/auto/tools/CMakeLists.txt new file mode 100644 index 0000000000..048051663d --- /dev/null +++ b/tests/auto/tools/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from tools.pro. + +add_subdirectory(qmakelib) +# special case begin +if(NOT WIN32) # @todo: this is broken, see QTBUG-78449 + add_subdirectory(qmake) +endif() +# special case end +#add_subdirectory(moc) +add_subdirectory(rcc) +if(TARGET Qt::Widgets) + add_subdirectory(uic) +endif() +if(TARGET Qt::DBus) + add_subdirectory(qdbuscpp2xml) + add_subdirectory(qdbusxml2cpp) +endif() diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json index 27e25dc01c..77647329c9 100644 --- a/tests/auto/tools/moc/allmocs_baseline_in.json +++ b/tests/auto/tools/moc/allmocs_baseline_in.json @@ -2,71 +2,6 @@ { "classes": [ { - "className": "MyBooooooostishClass", - "object": true, - "qualifiedClassName": "MyBooooooostishClass", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - } - ], - "slots": [ - { - "access": "public", - "name": "mySlot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "no-keywords.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "Task87883", - "object": true, - "qualifiedClassName": "Task87883", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "task87883.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "IfdefedClass", - "object": true, - "qualifiedClassName": "IfdefedClass", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "c-comments.h", - "outputRevision": 67 - }, - { - "classes": [ - { "className": "BackslashNewlines", "object": true, "qualifiedClassName": "BackslashNewlines", @@ -91,351 +26,9 @@ { "classes": [ { - "className": "OldStyleCast", - "object": true, - "qualifiedClassName": "OldStyleCast", - "slots": [ - { - "access": "public", - "name": "foo", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "int" - }, - { - "type": "int*" - }, - { - "type": "const int*" - }, - { - "type": "volatile int*" - }, - { - "type": "const int*volatile*" - } - ], - "name": "bar", - "returnType": "int" - }, - { - "access": "public", - "arguments": [ - { - "type": "int" - }, - { - "type": "QObject*const" - } - ], - "name": "slot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "oldstyle-casts.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "SlotsWithVoidTemplateTest", - "object": true, - "qualifiedClassName": "SlotsWithVoidTemplateTest", - "signals": [ - { - "access": "public", - "arguments": [ - { - "type": "TestTemplate<void>" - } - ], - "name": "mySignal", - "returnType": "void" - }, - { - "access": "public", - "name": "myVoidSignal", - "returnType": "void" - }, - { - "access": "public", - "name": "myVoidSignal2", - "returnType": "void" - } - ], - "slots": [ - { - "access": "public", - "name": "dummySlot", - "returnType": "void" - }, - { - "access": "public", - "name": "dummySlot2", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "TestTemplate<void>" - } - ], - "name": "anotherSlot", - "returnType": "void" - }, - { - "access": "public", - "name": "mySlot", - "returnType": "TestTemplate<void>" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "slots-with-void-template.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "InvokableBeforeReturnType", - "methods": [ - { - "access": "public", - "name": "foo", - "returnType": "const char*" - } - ], - "object": true, - "qualifiedClassName": "InvokableBeforeReturnType", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "InvokableBeforeInline", - "methods": [ - { - "access": "public", - "name": "foo", - "returnType": "void" - }, - { - "access": "public", - "name": "bar", - "returnType": "void" - } - ], - "object": true, - "qualifiedClassName": "InvokableBeforeInline", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "qinvokable.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "Bar", - "enums": [ - { - "alias": "Flag", - "isClass": false, - "isFlag": true, - "name": "Flags", - "values": [ - "Read", - "Write" - ] - } - ], - "object": true, - "properties": [ - { - "constant": false, - "designable": true, - "final": false, - "name": "flags", - "read": "flags", - "required": false, - "scriptable": true, - "stored": true, - "type": "Flags", - "user": false, - "write": "setFlags" - } - ], - "qualifiedClassName": "Foo::Bar", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "Baz", - "object": true, - "properties": [ - { - "constant": false, - "designable": true, - "final": false, - "name": "flags", - "read": "flags", - "required": false, - "scriptable": true, - "stored": true, - "type": "Foo::Bar::Flags", - "user": false, - "write": "setFlags" - }, - { - "constant": false, - "designable": true, - "final": false, - "name": "flagsList", - "read": "flagsList", - "required": false, - "scriptable": true, - "stored": true, - "type": "QList<Foo::Bar::Flags>", - "user": false, - "write": "setFlagsList" - } - ], - "qualifiedClassName": "Foo::Baz", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "namespaced-flags.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "Foo", - "object": true, - "qualifiedClassName": "BBB::Foo", - "signals": [ - { - "access": "public", - "arguments": [ - { - "type": "QList<QList<int> >" - } - ], - "name": "foo", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "QList<QList<int> >" - } - ], - "name": "foo2", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "QList< ::AAA::BaseA*>" - } - ], - "name": "bar", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "QList< ::AAA::BaseA*>" - } - ], - "name": "bar2", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "QList<const ::AAA::BaseA*>" - } - ], - "name": "bar3", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - }, - { - "access": "public", - "name": "::AAA::BaseA" - } - ] - } - ], - "inputFile": "trigraphs.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "classInfos": [ - { - "name": "Test", - "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\x53" - }, - { - "name": "Test2", - "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\123" - }, - { - "name": "Test3", - "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\nb" - } - ], - "className": "StringLiterals", + "className": "IfdefedClass", "object": true, - "qualifiedClassName": "StringLiterals", + "qualifiedClassName": "IfdefedClass", "superClasses": [ { "access": "public", @@ -444,7 +37,7 @@ ] } ], - "inputFile": "escapes-in-string-literals.h", + "inputFile": "c-comments.h", "outputRevision": 67 }, { @@ -481,487 +74,6 @@ { "classes": [ { - "className": "TestQPrivateSlots", - "methods": [ - { - "access": "private", - "name": "method1", - "returnType": "void" - } - ], - "object": true, - "qualifiedClassName": "TestQPrivateSlots", - "slots": [ - { - "access": "private", - "name": "_q_privateslot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "qprivateslots.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "GadgetWithNoEnums", - "gadget": true, - "qualifiedClassName": "GadgetWithNoEnums" - }, - { - "className": "DerivedGadgetWithEnums", - "enums": [ - { - "isClass": false, - "isFlag": false, - "name": "FooEnum", - "values": [ - "FooValue" - ] - } - ], - "gadget": true, - "qualifiedClassName": "DerivedGadgetWithEnums", - "superClasses": [ - { - "access": "public", - "name": "GadgetWithNoEnums" - } - ] - } - ], - "inputFile": "gadgetwithnoenums.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "DirInIncludePath", - "interfaces": [ - [ - { - "className": "MyInterface", - "id": "\"MyInterface\"" - } - ] - ], - "object": true, - "qualifiedClassName": "DirInIncludePath", - "superClasses": [ - { - "access": "public", - "name": "QObject" - }, - { - "access": "public", - "name": "MyInterface" - } - ] - } - ], - "inputFile": "dir-in-include-path.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "SingleFunctionKeywordBeforeReturnType", - "object": true, - "qualifiedClassName": "SingleFunctionKeywordBeforeReturnType", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - } - ], - "slots": [ - { - "access": "public", - "name": "mySlot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "SingleFunctionKeywordBeforeInline", - "object": true, - "qualifiedClassName": "SingleFunctionKeywordBeforeInline", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - } - ], - "slots": [ - { - "access": "public", - "name": "mySlot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "SingleFunctionKeywordAfterInline", - "object": true, - "qualifiedClassName": "SingleFunctionKeywordAfterInline", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - } - ], - "slots": [ - { - "access": "public", - "name": "mySlot", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "single_function_keyword.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "Task192552", - "object": true, - "qualifiedClassName": "Task192552", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "task192552.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "InlineSlotsWithThrowDeclaration", - "object": true, - "qualifiedClassName": "InlineSlotsWithThrowDeclaration", - "slots": [ - { - "access": "public", - "name": "a", - "returnType": "void" - }, - { - "access": "public", - "name": "b", - "returnType": "void" - }, - { - "access": "public", - "name": "c", - "returnType": "void" - }, - { - "access": "public", - "name": "d", - "returnType": "void" - }, - { - "access": "public", - "name": "e", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "task189996.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "TestObject", - "object": true, - "qualifiedClassName": "NS_A::NS_B::TestObject", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "TestMain", - "object": true, - "qualifiedClassName": "NS_A::NS_Main::TestMain", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "task234909.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "TypenameWithUnsigned", - "object": true, - "qualifiedClassName": "TypenameWithUnsigned", - "slots": [ - { - "access": "public", - "arguments": [ - { - "type": "uint" - } - ], - "name": "a", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "u", - "type": "uint" - } - ], - "name": "b", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "uint*" - } - ], - "name": "c", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "p", - "type": "uint*" - } - ], - "name": "d", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "uint&" - } - ], - "name": "e", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "r", - "type": "uint&" - } - ], - "name": "f", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "unsigned1" - } - ], - "name": "g", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "u1", - "type": "unsigned1" - } - ], - "name": "h", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "uint" - }, - { - "type": "unsigned1" - } - ], - "name": "i", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "unsigned1" - }, - { - "type": "uint" - } - ], - "name": "j", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "type": "unsignedQImage" - } - ], - "name": "k", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "uqi", - "type": "unsignedQImage" - } - ], - "name": "l", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "task240368.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "PureVirtualSignalsTest", - "object": true, - "qualifiedClassName": "PureVirtualSignalsTest", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - }, - { - "access": "public", - "name": "myOtherSignal", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "foo", - "type": "int" - } - ], - "name": "mySignal2", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "PureVirtualSignalsImpl", - "object": true, - "qualifiedClassName": "PureVirtualSignalsImpl", - "signals": [ - { - "access": "public", - "name": "mySignal", - "returnType": "void" - }, - { - "access": "public", - "arguments": [ - { - "name": "foo", - "type": "int" - } - ], - "name": "mySignal2", - "returnType": "void" - } - ], - "superClasses": [ - { - "access": "public", - "name": "PureVirtualSignalsTest" - } - ] - } - ], - "inputFile": "pure-virtual-signals.h", - "outputRevision": 67 - }, - { - "classes": [ - { "className": "CXX11Enums", "enums": [ { @@ -1128,111 +240,6 @@ { "classes": [ { - "className": "FinalTestClassQt", - "object": true, - "qualifiedClassName": "FinalTestClassQt", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedFinalTestClassQt", - "object": true, - "qualifiedClassName": "ExportedFinalTestClassQt", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedFinalTestClassQtX", - "object": true, - "qualifiedClassName": "ExportedFinalTestClassQtX", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "FinalTestClassCpp11", - "object": true, - "qualifiedClassName": "FinalTestClassCpp11", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedFinalTestClassCpp11", - "object": true, - "qualifiedClassName": "ExportedFinalTestClassCpp11", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedFinalTestClassCpp11X", - "object": true, - "qualifiedClassName": "ExportedFinalTestClassCpp11X", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "SealedTestClass", - "object": true, - "qualifiedClassName": "SealedTestClass", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedSealedTestClass", - "object": true, - "qualifiedClassName": "ExportedSealedTestClass", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, - { - "className": "ExportedSealedTestClassX", - "object": true, - "qualifiedClassName": "ExportedSealedTestClassX", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - } - ], - "inputFile": "cxx11-final-classes.h", - "outputRevision": 67 - }, - { - "classes": [ - { "className": "ExplicitOverrideControlBase", "object": true, "qualifiedClassName": "ExplicitOverrideControlBase", @@ -1536,6 +543,207 @@ { "classes": [ { + "className": "FinalTestClassQt", + "object": true, + "qualifiedClassName": "FinalTestClassQt", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedFinalTestClassQt", + "object": true, + "qualifiedClassName": "ExportedFinalTestClassQt", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedFinalTestClassQtX", + "object": true, + "qualifiedClassName": "ExportedFinalTestClassQtX", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "FinalTestClassCpp11", + "object": true, + "qualifiedClassName": "FinalTestClassCpp11", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedFinalTestClassCpp11", + "object": true, + "qualifiedClassName": "ExportedFinalTestClassCpp11", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedFinalTestClassCpp11X", + "object": true, + "qualifiedClassName": "ExportedFinalTestClassCpp11X", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "SealedTestClass", + "object": true, + "qualifiedClassName": "SealedTestClass", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedSealedTestClass", + "object": true, + "qualifiedClassName": "ExportedSealedTestClass", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "ExportedSealedTestClassX", + "object": true, + "qualifiedClassName": "ExportedSealedTestClassX", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "cxx11-final-classes.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "ClassInNamespace", + "enums": [ + { + "isClass": false, + "isFlag": false, + "name": "GadEn", + "values": [ + "Value" + ] + } + ], + "gadget": true, + "qualifiedClassName": "CXX17Namespace::A::B::C::D::ClassInNamespace" + }, + { + "className": "D", + "enums": [ + { + "isClass": false, + "isFlag": false, + "name": "NamEn", + "values": [ + "Value" + ] + } + ], + "namespace": true, + "qualifiedClassName": "CXX17Namespace::A::B::C::D" + } + ], + "inputFile": "cxx17-namespaces.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "DirInIncludePath", + "interfaces": [ + [ + { + "className": "MyInterface", + "id": "\"MyInterface\"" + } + ] + ], + "object": true, + "qualifiedClassName": "DirInIncludePath", + "superClasses": [ + { + "access": "public", + "name": "QObject" + }, + { + "access": "public", + "name": "MyInterface" + } + ] + } + ], + "inputFile": "dir-in-include-path.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "classInfos": [ + { + "name": "Test", + "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\x53" + }, + { + "name": "Test2", + "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\123" + }, + { + "name": "Test3", + "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\nb" + } + ], + "className": "StringLiterals", + "object": true, + "qualifiedClassName": "StringLiterals", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "escapes-in-string-literals.h", + "outputRevision": 67 + }, + { + "classes": [ + { "className": "ForwardDeclaredParamClass", "object": true, "qualifiedClassName": "ForwardDeclaredParamClass", @@ -1737,6 +945,422 @@ { "classes": [ { + "className": "FunctionWithAttributes", + "object": true, + "qualifiedClassName": "FunctionWithAttributes", + "slots": [ + { + "access": "public", + "name": "test1", + "returnType": "void" + }, + { + "access": "public", + "name": "test2", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "function-with-attributes.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "GadgetWithNoEnums", + "gadget": true, + "qualifiedClassName": "GadgetWithNoEnums" + }, + { + "className": "DerivedGadgetWithEnums", + "enums": [ + { + "isClass": false, + "isFlag": false, + "name": "FooEnum", + "values": [ + "FooValue" + ] + } + ], + "gadget": true, + "qualifiedClassName": "DerivedGadgetWithEnums", + "superClasses": [ + { + "access": "public", + "name": "GadgetWithNoEnums" + } + ] + } + ], + "inputFile": "gadgetwithnoenums.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "BaseGadget", + "gadget": true, + "qualifiedClassName": "GrandParentGadget::BaseGadget" + }, + { + "className": "DerivedGadget", + "gadget": true, + "qualifiedClassName": "GrandParentGadget::DerivedGadget", + "superClasses": [ + { + "access": "public", + "name": "Derived" + } + ] + }, + { + "className": "CRTPDerivedGadget", + "gadget": true, + "qualifiedClassName": "GrandParentGadget::CRTPDerivedGadget", + "superClasses": [ + { + "access": "public", + "name": "CRTP<CRTPDerivedGadget>" + } + ] + } + ], + "inputFile": "grand-parent-gadget-class.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "TestFwdProperties", + "object": true, + "properties": [ + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "prop1", + "read": "getProp1", + "required": false, + "scriptable": true, + "stored": true, + "type": "FwdClass1", + "user": false, + "write": "setProp1" + }, + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "prop2", + "read": "getProp2", + "required": false, + "scriptable": true, + "stored": true, + "type": "FwdClass2", + "user": false, + "write": "setProp2" + }, + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "prop3", + "read": "getProp3", + "required": false, + "scriptable": true, + "stored": true, + "type": "FwdClass3", + "user": false, + "write": "setProp3" + } + ], + "qualifiedClassName": "TestFwdProperties", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "SomeRandomNamespace", + "namespace": true, + "qualifiedClassName": "SomeRandomNamespace" + } + ], + "inputFile": "moc_include.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "FooNamespace", + "enums": [ + { + "isClass": true, + "isFlag": false, + "name": "Enum1", + "values": [ + "Key1", + "Key2" + ] + } + ], + "namespace": true, + "qualifiedClassName": "FooNamespace" + }, + { + "className": "FooNestedNamespace", + "enums": [ + { + "isClass": true, + "isFlag": false, + "name": "Enum2", + "values": [ + "Key3", + "Key4" + ] + }, + { + "isClass": true, + "isFlag": false, + "name": "Enum3", + "values": [ + "Key5", + "Key6" + ] + } + ], + "namespace": true, + "qualifiedClassName": "FooNamespace::FooNestedNamespace" + }, + { + "className": "FooMoreNestedNamespace", + "enums": [ + { + "isClass": true, + "isFlag": false, + "name": "Enum4", + "values": [ + "Key7", + "Key8" + ] + } + ], + "namespace": true, + "qualifiedClassName": "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace" + } + ], + "inputFile": "namespace.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "Bar", + "enums": [ + { + "alias": "Flag", + "isClass": false, + "isFlag": true, + "name": "Flags", + "values": [ + "Read", + "Write" + ] + } + ], + "object": true, + "properties": [ + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "flags", + "read": "flags", + "required": false, + "scriptable": true, + "stored": true, + "type": "Flags", + "user": false, + "write": "setFlags" + } + ], + "qualifiedClassName": "Foo::Bar", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "Baz", + "object": true, + "properties": [ + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "flags", + "read": "flags", + "required": false, + "scriptable": true, + "stored": true, + "type": "Foo::Bar::Flags", + "user": false, + "write": "setFlags" + }, + { + "constant": false, + "designable": true, + "final": false, + "isQProperty": false, + "name": "flagsList", + "read": "flagsList", + "required": false, + "scriptable": true, + "stored": true, + "type": "QVector<Foo::Bar::Flags>", + "user": false, + "write": "setFlagsList" + } + ], + "qualifiedClassName": "Foo::Baz", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "namespaced-flags.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "MyBooooooostishClass", + "object": true, + "qualifiedClassName": "MyBooooooostishClass", + "signals": [ + { + "access": "public", + "name": "mySignal", + "returnType": "void" + } + ], + "slots": [ + { + "access": "public", + "name": "mySlot", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "no-keywords.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "Derived", + "gadget": true, + "qualifiedClassName": "NonGadgetParent::Derived", + "superClasses": [ + { + "access": "public", + "name": "Base" + } + ] + } + ], + "inputFile": "non-gadget-parent-class.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "OldStyleCast", + "object": true, + "qualifiedClassName": "OldStyleCast", + "slots": [ + { + "access": "public", + "name": "foo", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "int" + }, + { + "type": "int*" + }, + { + "type": "const int*" + }, + { + "type": "volatile int*" + }, + { + "type": "const int*volatile*" + } + ], + "name": "bar", + "returnType": "int" + }, + { + "access": "public", + "arguments": [ + { + "type": "int" + }, + { + "type": "QObject*" + } + ], + "name": "slot", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "oldstyle-casts.h", + "outputRevision": 67 + }, + { + "classes": [ + { "classInfos": [ { "name": "TestString", @@ -1937,18 +1561,46 @@ { "classes": [ { - "className": "FunctionWithAttributes", + "className": "TestPluginMetaData", "object": true, - "qualifiedClassName": "FunctionWithAttributes", - "slots": [ + "qualifiedClassName": "TestPluginMetaData", + "superClasses": [ { "access": "public", - "name": "test1", + "name": "QObject" + } + ] + } + ], + "inputFile": "plugin_metadata.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "PureVirtualSignalsTest", + "object": true, + "qualifiedClassName": "PureVirtualSignalsTest", + "signals": [ + { + "access": "public", + "name": "mySignal", "returnType": "void" }, { "access": "public", - "name": "test2", + "name": "myOtherSignal", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "foo", + "type": "int" + } + ], + "name": "mySignal2", "returnType": "void" } ], @@ -1958,17 +1610,76 @@ "name": "QObject" } ] + }, + { + "className": "PureVirtualSignalsImpl", + "object": true, + "qualifiedClassName": "PureVirtualSignalsImpl", + "signals": [ + { + "access": "public", + "name": "mySignal", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "foo", + "type": "int" + } + ], + "name": "mySignal2", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "PureVirtualSignalsTest" + } + ] } ], - "inputFile": "function-with-attributes.h", + "inputFile": "pure-virtual-signals.h", "outputRevision": 67 }, { "classes": [ { - "className": "TestPluginMetaData", + "className": "InvokableBeforeReturnType", + "methods": [ + { + "access": "public", + "name": "foo", + "returnType": "const char*" + } + ], "object": true, - "qualifiedClassName": "TestPluginMetaData", + "qualifiedClassName": "InvokableBeforeReturnType", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + }, + { + "className": "InvokableBeforeInline", + "methods": [ + { + "access": "public", + "name": "foo", + "returnType": "void" + }, + { + "access": "public", + "name": "bar", + "returnType": "void" + } + ], + "object": true, + "qualifiedClassName": "InvokableBeforeInline", "superClasses": [ { "access": "public", @@ -1977,25 +1688,29 @@ ] } ], - "inputFile": "plugin_metadata.h", + "inputFile": "qinvokable.h", "outputRevision": 67 }, { "classes": [ { - "className": "KDAB", - "enums": [ + "className": "TestQPrivateSlots", + "methods": [ { - "isClass": false, - "isFlag": false, - "name": "Salaries", - "values": [ - "Steve" - ] + "access": "private", + "name": "method1", + "returnType": "void" } ], "object": true, - "qualifiedClassName": "KDAB", + "qualifiedClassName": "TestQPrivateSlots", + "slots": [ + { + "access": "private", + "name": "_q_privateslot", + "returnType": "void" + } + ], "superClasses": [ { "access": "public", @@ -2004,7 +1719,7 @@ ] } ], - "inputFile": "single-quote-digit-separator-n3781.h", + "inputFile": "qprivateslots.h", "outputRevision": 67 }, { @@ -2021,15 +1736,15 @@ ] } ], - "object": true, - "qualifiedClassName": "QTBUG_2151::A", - "superClasses": [ - { - "access": "public", - "name": "QObject" - } - ] - }, + "gadget": true, + "qualifiedClassName": "QTBUG_35657::A" + } + ], + "inputFile": "qtbug-35657-gadget.h", + "outputRevision": 67 + }, + { + "classes": [ { "className": "B", "object": true, @@ -2038,6 +1753,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "blah", "read": "blah", "required": false, @@ -2047,7 +1763,7 @@ "user": false } ], - "qualifiedClassName": "QTBUG_2151::B", + "qualifiedClassName": "QTBUG_35657::B", "superClasses": [ { "access": "public", @@ -2056,7 +1772,7 @@ ] } ], - "inputFile": "related-metaobjects-in-namespaces.h", + "inputFile": "related-metaobjects-in-gadget.h", "outputRevision": 67 }, { @@ -2073,66 +1789,16 @@ ] } ], - "gadget": true, - "qualifiedClassName": "QTBUG_35657::A" - } - ], - "inputFile": "qtbug-35657-gadget.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "Derived", - "gadget": true, - "qualifiedClassName": "NonGadgetParent::Derived", - "superClasses": [ - { - "access": "public", - "name": "Base" - } - ] - } - ], - "inputFile": "non-gadget-parent-class.h", - "outputRevision": 67 - }, - { - "classes": [ - { - "className": "BaseGadget", - "gadget": true, - "qualifiedClassName": "GrandParentGadget::BaseGadget" - }, - { - "className": "DerivedGadget", - "gadget": true, - "qualifiedClassName": "GrandParentGadget::DerivedGadget", + "object": true, + "qualifiedClassName": "QTBUG_2151::A", "superClasses": [ { "access": "public", - "name": "Derived" + "name": "QObject" } ] }, { - "className": "CRTPDerivedGadget", - "gadget": true, - "qualifiedClassName": "GrandParentGadget::CRTPDerivedGadget", - "superClasses": [ - { - "access": "public", - "name": "CRTP<CRTPDerivedGadget>" - } - ] - } - ], - "inputFile": "grand-parent-gadget-class.h", - "outputRevision": 67 - }, - { - "classes": [ - { "className": "B", "object": true, "properties": [ @@ -2140,6 +1806,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "blah", "read": "blah", "required": false, @@ -2149,7 +1816,7 @@ "user": false } ], - "qualifiedClassName": "QTBUG_35657::B", + "qualifiedClassName": "QTBUG_2151::B", "superClasses": [ { "access": "public", @@ -2158,7 +1825,7 @@ ] } ], - "inputFile": "related-metaobjects-in-gadget.h", + "inputFile": "related-metaobjects-in-namespaces.h", "outputRevision": 67 }, { @@ -2315,6 +1982,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "gadgetPoperty", "read": "gadgetPoperty", "required": false, @@ -2327,6 +1995,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "objectPoperty", "read": "objectPoperty", "required": false, @@ -2352,6 +2021,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "nestedGadgetPoperty", "read": "nestedGadgetPoperty", "required": false, @@ -2377,6 +2047,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "nestedObjectPoperty", "read": "nestedObjectPoperty", "required": false, @@ -2510,6 +2181,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "gadgetPoperty", "read": "gadgetPoperty", "required": false, @@ -2522,6 +2194,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "objectPoperty", "read": "objectPoperty", "required": false, @@ -2547,6 +2220,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "nestedGadgetPoperty", "read": "nestedGadgetPoperty", "required": false, @@ -2572,6 +2246,7 @@ "constant": false, "designable": true, "final": false, + "isQProperty": false, "name": "nestedObjectPoperty", "read": "nestedObjectPoperty", "required": false, @@ -2596,100 +2271,460 @@ { "classes": [ { - "className": "FooNamespace", + "className": "KDAB", "enums": [ { - "isClass": true, + "isClass": false, "isFlag": false, - "name": "Enum1", + "name": "Salaries", "values": [ - "Key1", - "Key2" + "Steve" ] } ], - "namespace": true, - "qualifiedClassName": "FooNamespace" + "object": true, + "qualifiedClassName": "KDAB", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "single-quote-digit-separator-n3781.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "SingleFunctionKeywordBeforeReturnType", + "object": true, + "qualifiedClassName": "SingleFunctionKeywordBeforeReturnType", + "signals": [ + { + "access": "public", + "name": "mySignal", + "returnType": "void" + } + ], + "slots": [ + { + "access": "public", + "name": "mySlot", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] }, { - "className": "FooNestedNamespace", - "enums": [ + "className": "SingleFunctionKeywordBeforeInline", + "object": true, + "qualifiedClassName": "SingleFunctionKeywordBeforeInline", + "signals": [ { - "isClass": true, - "isFlag": false, - "name": "Enum2", - "values": [ - "Key3", - "Key4" - ] - }, + "access": "public", + "name": "mySignal", + "returnType": "void" + } + ], + "slots": [ { - "isClass": true, - "isFlag": false, - "name": "Enum3", - "values": [ - "Key5", - "Key6" - ] + "access": "public", + "name": "mySlot", + "returnType": "void" } ], - "namespace": true, - "qualifiedClassName": "FooNamespace::FooNestedNamespace" + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] }, { - "className": "FooMoreNestedNamespace", - "enums": [ + "className": "SingleFunctionKeywordAfterInline", + "object": true, + "qualifiedClassName": "SingleFunctionKeywordAfterInline", + "signals": [ { - "isClass": true, - "isFlag": false, - "name": "Enum4", - "values": [ - "Key7", - "Key8" - ] + "access": "public", + "name": "mySignal", + "returnType": "void" } ], - "namespace": true, - "qualifiedClassName": "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace" + "slots": [ + { + "access": "public", + "name": "mySlot", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] } ], - "inputFile": "namespace.h", + "inputFile": "single_function_keyword.h", "outputRevision": 67 }, { "classes": [ { - "className": "ClassInNamespace", - "enums": [ + "className": "SlotsWithVoidTemplateTest", + "object": true, + "qualifiedClassName": "SlotsWithVoidTemplateTest", + "signals": [ { - "isClass": false, - "isFlag": false, - "name": "GadEn", - "values": [ - "Value" - ] + "access": "public", + "arguments": [ + { + "type": "TestTemplate<void>" + } + ], + "name": "mySignal", + "returnType": "void" + }, + { + "access": "public", + "name": "myVoidSignal", + "returnType": "void" + }, + { + "access": "public", + "name": "myVoidSignal2", + "returnType": "void" } ], - "gadget": true, - "qualifiedClassName": "CXX17Namespace::A::B::C::D::ClassInNamespace" + "slots": [ + { + "access": "public", + "name": "dummySlot", + "returnType": "void" + }, + { + "access": "public", + "name": "dummySlot2", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "TestTemplate<void>" + } + ], + "name": "anotherSlot", + "returnType": "void" + }, + { + "access": "public", + "name": "mySlot", + "returnType": "TestTemplate<void>" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "slots-with-void-template.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "Task192552", + "object": true, + "qualifiedClassName": "Task192552", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "task192552.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "TestObject", + "object": true, + "qualifiedClassName": "NS_A::NS_B::TestObject", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] }, { - "className": "D", - "enums": [ + "className": "TestMain", + "object": true, + "qualifiedClassName": "NS_A::NS_Main::TestMain", + "superClasses": [ { - "isClass": false, - "isFlag": false, - "name": "NamEn", - "values": [ - "Value" - ] + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "task234909.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "TypenameWithUnsigned", + "object": true, + "qualifiedClassName": "TypenameWithUnsigned", + "slots": [ + { + "access": "public", + "arguments": [ + { + "type": "uint" + } + ], + "name": "a", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "u", + "type": "uint" + } + ], + "name": "b", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "uint*" + } + ], + "name": "c", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "p", + "type": "uint*" + } + ], + "name": "d", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "uint&" + } + ], + "name": "e", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "r", + "type": "uint&" + } + ], + "name": "f", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "unsigned1" + } + ], + "name": "g", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "u1", + "type": "unsigned1" + } + ], + "name": "h", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "uint" + }, + { + "type": "unsigned1" + } + ], + "name": "i", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "unsigned1" + }, + { + "type": "uint" + } + ], + "name": "j", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "unsignedQImage" + } + ], + "name": "k", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "name": "uqi", + "type": "unsignedQImage" + } + ], + "name": "l", + "returnType": "void" } ], - "namespace": true, - "qualifiedClassName": "CXX17Namespace::A::B::C::D" + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] } ], - "inputFile": "cxx17-namespaces.h", + "inputFile": "task240368.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "Task87883", + "object": true, + "qualifiedClassName": "Task87883", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "task87883.h", + "outputRevision": 67 + }, + { + "classes": [ + { + "className": "Foo", + "object": true, + "qualifiedClassName": "BBB::Foo", + "signals": [ + { + "access": "public", + "arguments": [ + { + "type": "QVector<QVector<int>>" + } + ], + "name": "foo", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "QVector<QVector<int>>" + } + ], + "name": "foo2", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "QVector<::AAA::BaseA*>" + } + ], + "name": "bar", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "QVector<::AAA::BaseA*>" + } + ], + "name": "bar2", + "returnType": "void" + }, + { + "access": "public", + "arguments": [ + { + "type": "QVector<const ::AAA::BaseA*>" + } + ], + "name": "bar3", + "returnType": "void" + } + ], + "superClasses": [ + { + "access": "public", + "name": "QObject" + }, + { + "access": "public", + "name": "::AAA::BaseA" + } + ] + } + ], + "inputFile": "trigraphs.h", "outputRevision": 67 } ] diff --git a/tests/auto/tools/moc/task189996.h b/tests/auto/tools/moc/fwdclass1.h index f94a051b3a..a8457cca77 100644 --- a/tests/auto/tools/moc/task189996.h +++ b/tests/auto/tools/moc/fwdclass1.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -25,23 +25,14 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -// inline functions can have throw declarations -#ifndef TASK189996_H -#define TASK189996_H - -#include <QObject> +#ifdef FWDCLASS1_H +#error "This file can only be included once" +#endif +#define FWDCLASS1_H -class InlineSlotsWithThrowDeclaration : public QObject +class FwdClass1 { - Q_OBJECT - -public slots: - void a() throw() { } - void b() const throw() { } - void c() throw(); - void d() throw(int) { } - void e() const throw(int,double) { } +public: + int x; }; - -#endif diff --git a/tests/auto/tools/moc/fwdclass2.h b/tests/auto/tools/moc/fwdclass2.h new file mode 100644 index 0000000000..650da18116 --- /dev/null +++ b/tests/auto/tools/moc/fwdclass2.h @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifdef FWDCLASS2_H +#error "This file can only be included once" +#endif +#define FWDCLASS2_H + +class FwdClass2 +{ +public: + int x; +}; diff --git a/tests/auto/tools/moc/fwdclass3.h b/tests/auto/tools/moc/fwdclass3.h new file mode 100644 index 0000000000..080ac0340d --- /dev/null +++ b/tests/auto/tools/moc/fwdclass3.h @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifdef FWDCLASS3_H +#error "This file can only be included once" +#endif +#define FWDCLASS3_H + +class FwdClass3 +{ +public: + int x; +}; diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 1794bafd2c..094c76227b 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -15,7 +15,7 @@ cross_compile: DEFINES += MOC_CROSS_COMPILED HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-newlines.h oldstyle-casts.h \ slots-with-void-template.h qinvokable.h namespaced-flags.h trigraphs.h \ escapes-in-string-literals.h cstyle-enums.h qprivateslots.h gadgetwithnoenums.h \ - dir-in-include-path.h single_function_keyword.h task192552.h task189996.h \ + dir-in-include-path.h single_function_keyword.h task192552.h \ task234909.h task240368.h pure-virtual-signals.h cxx11-enums.h \ cxx11-final-classes.h \ cxx11-explicit-override-control.h \ @@ -30,7 +30,8 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n related-metaobjects-in-gadget.h \ related-metaobjects-name-conflict.h \ namespace.h cxx17-namespaces.h \ - cxx-attributes.h + cxx-attributes.h \ + moc_include.h # No platform specifics in the JSON files, so that we can compare them JSON_HEADERS = $$HEADERS diff --git a/tests/auto/tools/moc/moc_include.h b/tests/auto/tools/moc/moc_include.h new file mode 100644 index 0000000000..49b484a0c9 --- /dev/null +++ b/tests/auto/tools/moc/moc_include.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MOC_INCLUDE_H +#define MOC_INCLUDE_H + +#include <QObject> + +class FwdClass1; +class FwdClass2; +class FwdClass3; + +Q_MOC_INCLUDE(fwdclass3.h) + +namespace SomeRandomNamespace { +Q_MOC_INCLUDE("fwdclass1.h") +Q_NAMESPACE +} + +class TestFwdProperties : public QObject +{ + Q_OBJECT + Q_PROPERTY(FwdClass1 prop1 WRITE setProp1 READ getProp1) + Q_PROPERTY(FwdClass2 prop2 WRITE setProp2 READ getProp2) + Q_PROPERTY(FwdClass3 prop3 WRITE setProp3 READ getProp3) +public: + ~TestFwdProperties(); + + void setProp1(const FwdClass1 &val); + void setProp2(const FwdClass2 &val); + void setProp3(const FwdClass3 &val); + const FwdClass1 &getProp1() { return *prop1; } + const FwdClass2 &getProp2() { return *prop2; } + const FwdClass3 &getProp3() { return *prop3; } + + QScopedPointer<FwdClass1> prop1; + QScopedPointer<FwdClass2> prop2; + QScopedPointer<FwdClass3> prop3; + + Q_MOC_INCLUDE( + \ + "fwdclass2.h" + ) + +}; + +Q_MOC_INCLUDE(<QString>) + +#endif // MOC_INCLUDE_H diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 0f801fe902..08dae7f6ca 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com> +** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -27,13 +27,13 @@ ** ****************************************************************************/ - - #include <QtTest/QtTest> #include <stdio.h> #include <qobject.h> #include <qmetaobject.h> #include <qjsondocument.h> +#include <qversionnumber.h> +#include <qregularexpression.h> #include "using-namespaces.h" #include "assign-namespace.h" @@ -74,6 +74,11 @@ #include "cxx17-namespaces.h" #include "cxx-attributes.h" +#include "moc_include.h" +#include "fwdclass1.h" +#include "fwdclass2.h" +#include "fwdclass3.h" + #ifdef Q_MOC_RUN // check that moc can parse these constructs, they are being used in Windows winsock2.h header #define STRING_HASH_HASH(x) ("foo" ## x ## "bar") @@ -630,7 +635,6 @@ public: private slots: void initTestCase(); - void slotWithException() throw(MyStruct); void dontStripNamespaces(); void oldStyleCasts(); void warnOnExtraSignalSlotQualifiaction(); @@ -672,7 +676,6 @@ private slots: void templateGtGt(); void qprivateslots(); void qprivateproperties(); - void inlineSlotsWithThrowDeclaration(); void warnOnPropertyWithoutREAD(); void constructors(); void typenameWithUnsigned(); @@ -719,7 +722,11 @@ private slots: void cxx17Namespaces(); void cxxAttributes(); void mocJsonOutput(); + void mocInclude(); void requiredProperties(); + void qpropertyMembers(); + void observerMetaCall(); + void setQPRopertyBinding(); signals: void sigWithUnsignedArg(unsigned foo); @@ -782,12 +789,6 @@ void tst_Moc::initTestCase() #endif } -void tst_Moc::slotWithException() throw(MyStruct) -{ - // be happy - QVERIFY(true); -} - void tst_Moc::dontStripNamespaces() { Sender sender; @@ -822,7 +823,7 @@ void tst_Moc::oldStyleCasts() QStringList args; args << "-c" << "-x" << "c++" << "-Wold-style-cast" << "-I" << "." - << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-"; + << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-"; proc.start("gcc", args); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -892,7 +893,7 @@ void tst_Moc::inputFileNameWithDotsButNoExtension() QStringList args; args << "-c" << "-x" << "c++" << "-I" << ".." - << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-"; + << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-"; proc.start("gcc", args); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -1172,7 +1173,7 @@ void tst_Moc::ignoreOptionClashes() QStringList gccArgs; gccArgs << "-c" << "-x" << "c++" << "-I" << ".." << "-I" << qtIncludePath << "-I" << includeDir << "-o" << "/dev/null" - << "-fPIC" << "-std=c++11" << "-"; + << "-fPIC" << "-std=c++1z" << "-"; proc.start("gcc", gccArgs); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -1591,21 +1592,6 @@ void tst_Moc::qprivateproperties() } -#include "task189996.h" - -void InlineSlotsWithThrowDeclaration::c() throw() {} - -void tst_Moc::inlineSlotsWithThrowDeclaration() -{ - InlineSlotsWithThrowDeclaration tst; - const QMetaObject *mobj = tst.metaObject(); - QVERIFY(mobj->indexOfSlot("a()") != -1); - QVERIFY(mobj->indexOfSlot("b()") != -1); - QVERIFY(mobj->indexOfSlot("c()") != -1); - QVERIFY(mobj->indexOfSlot("d()") != -1); - QVERIFY(mobj->indexOfSlot("e()") != -1); -} - void tst_Moc::warnOnPropertyWithoutREAD() { #ifdef MOC_CROSS_COMPILED @@ -1621,7 +1607,7 @@ void tst_Moc::warnOnPropertyWithoutREAD() QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocWarning, header + - QString(":36: Warning: Property declaration foo has no READ accessor function or associated MEMBER variable. The property will be invalid.\n")); + QString(":36: Warning: Property declaration foo has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid.\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -1845,8 +1831,8 @@ void tst_Moc::QTBUG12260_defaultTemplate() { QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1); QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); - QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomethingElse(QSharedPointer<QVarLengthArray<QString,(16>>2)> >)") != -1); - QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QVector<QList<QString> >,QHash<int,QVector<QString> >)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomethingElse(QSharedPointer<QVarLengthArray<QString,(16>>2)>>)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QVector<QList<QString>>,QHash<int,QVector<QString>>)") != -1); } void tst_Moc::notifyError() @@ -1867,7 +1853,7 @@ void tst_Moc::notifyError() QStringList args; args << "-c" << "-x" << "c++" << "-I" << "." - << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-"; + << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-"; proc.start("gcc", args); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -1914,12 +1900,14 @@ class VersionTest : public QObject Q_OBJECT Q_PROPERTY(int prop1 READ foo) Q_PROPERTY(int prop2 READ foo REVISION 2) + Q_PROPERTY(int prop514 READ foo REVISION(5, 14)) public: int foo() const { return 0; } Q_INVOKABLE void method1() {} Q_INVOKABLE Q_REVISION(4) void method2() {} + Q_INVOKABLE Q_REVISION(6, 0) void method60() {} enum TestEnum { One, Two }; Q_ENUM(TestEnum); @@ -1928,18 +1916,26 @@ public: public slots: void slot1() {} Q_REVISION(3) void slot2() {} + Q_REVISION(6, 1) void slot61() {} signals: void signal1(); Q_REVISION(5) void signal2(); + Q_REVISION(6, 2) void signal62(); public slots Q_REVISION(6): void slot3() {} void slot4() {} +public slots Q_REVISION(5, 12): + void slot512() {} + signals Q_REVISION(7): void signal3(); void signal4(); + +signals Q_REVISION(5, 15): + void signal515(); }; // If changed, update VersionTest above @@ -1948,12 +1944,14 @@ class VersionTestNotify : public QObject Q_OBJECT Q_PROPERTY(int prop1 READ foo NOTIFY fooChanged) Q_PROPERTY(int prop2 READ foo REVISION 2) + Q_PROPERTY(int prop514 READ foo REVISION(5, 14)) public: int foo() const { return 0; } Q_INVOKABLE void method1() {} Q_INVOKABLE Q_REVISION(4) void method2() {} + Q_INVOKABLE Q_REVISION(6, 0) void method60() {} enum TestEnum { One, Two }; Q_ENUM(TestEnum); @@ -1961,19 +1959,27 @@ public: public slots: void slot1() {} Q_REVISION(3) void slot2() {} + Q_REVISION(6, 1) void slot61() {} signals: void fooChanged(); void signal1(); Q_REVISION(5) void signal2(); + Q_REVISION(6, 2) void signal62(); public slots Q_REVISION(6): void slot3() {} void slot4() {} +public slots Q_REVISION(5, 12): + void slot512() {} + signals Q_REVISION(7): void signal3(); void signal4(); + +signals Q_REVISION(5, 15): + void signal515(); }; template <class T> @@ -1982,32 +1988,58 @@ void tst_Moc::revisions_T() int idx = T::staticMetaObject.indexOfProperty("prop1"); QCOMPARE(T::staticMetaObject.property(idx).revision(), 0); idx = T::staticMetaObject.indexOfProperty("prop2"); - QCOMPARE(T::staticMetaObject.property(idx).revision(), 2); + QCOMPARE(T::staticMetaObject.property(idx).revision(), + QTypeRevision::fromMinorVersion(2).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfProperty("prop514"); + QCOMPARE(T::staticMetaObject.property(idx).revision(), + QTypeRevision::fromVersion(5, 14).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfMethod("method1()"); QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfMethod("method2()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 4); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(4).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfMethod("method60()"); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromVersion(6, 0).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSlot("slot1()"); QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfSlot("slot2()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 3); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(3).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfSlot("slot61()"); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromVersion(6, 1).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSlot("slot3()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 6); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(6).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSlot("slot4()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 6); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(6).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfSlot("slot512()"); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromVersion(5, 12).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSignal("signal1()"); QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfSignal("signal2()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 5); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(5).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfSignal("signal62()"); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromVersion(6, 2).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSignal("signal3()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 7); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(7).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfSignal("signal4()"); - QCOMPARE(T::staticMetaObject.method(idx).revision(), 7); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromMinorVersion(7).toEncodedVersion<int>()); + idx = T::staticMetaObject.indexOfSignal("signal515()"); + QCOMPARE(T::staticMetaObject.method(idx).revision(), + QTypeRevision::fromVersion(5, 15).toEncodedVersion<int>()); idx = T::staticMetaObject.indexOfEnumerator("TestEnum"); QCOMPARE(T::staticMetaObject.enumerator(idx).keyCount(), 2); @@ -2059,7 +2091,7 @@ void tst_Moc::warnings_data() << QStringList() << 0 << QString("IGNORE_ALL_STDOUT") - << QString("standard input:1: Warning: Property declaration x has no READ accessor function or associated MEMBER variable. The property will be invalid."); + << QString("standard input:1: Warning: Property declaration x has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid."); // This should output a warning QTest::newRow("Duplicate property warning") @@ -2075,7 +2107,7 @@ void tst_Moc::warnings_data() << (QStringList() << "-nn") << 0 << QString("IGNORE_ALL_STDOUT") - << QString("standard input:1: Warning: Property declaration x has no READ accessor function or associated MEMBER variable. The property will be invalid."); + << QString("standard input:1: Warning: Property declaration x has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid."); // Passing "-nw" should suppress the warning QTest::newRow("Invalid property warning with -nw") @@ -2223,8 +2255,7 @@ void tst_Moc::warnings() #ifdef Q_CC_MSVC // for some reasons, moc compiled with MSVC uses a different output format - QRegExp lineNumberRe(":(-?\\d+):"); - lineNumberRe.setMinimal(true); + QRegularExpression lineNumberRe(":(-?\\d+):", QRegularExpression::InvertedGreedinessOption); expectedStdErr.replace(lineNumberRe, "(\\1):"); #endif @@ -3917,7 +3948,7 @@ void tst_Moc::testQNamespace() EnumFromNamespaceClass obj; const QVariant prop = obj.property("prop"); - QCOMPARE(prop.type(), QMetaType::Int); + QCOMPARE(prop.userType(), QMetaType::fromType<FooNamespace::Enum1>().id()); QCOMPARE(prop.toInt(), int(FooNamespace::Enum1::Key2)); } @@ -4026,6 +4057,29 @@ void tst_Moc::mocJsonOutput() QVERIFY2(actualOutput == expectedOutput, showPotentialDiff(actualOutput, expectedOutput).constData()); } +void TestFwdProperties::setProp1(const FwdClass1 &v) +{ + prop1.reset(new FwdClass1(v)); +} +void TestFwdProperties::setProp2(const FwdClass2 &v) +{ + prop2.reset(new FwdClass2(v)); +} +void TestFwdProperties::setProp3(const FwdClass3 &v) +{ + prop3.reset(new FwdClass3(v)); +} +TestFwdProperties::~TestFwdProperties() {} + +Q_DECLARE_METATYPE(FwdClass1); + +void tst_Moc::mocInclude() +{ + TestFwdProperties obj; + obj.setProperty("prop1", QVariant::fromValue(FwdClass1 { 45 })); + QCOMPARE(obj.prop1->x, 45); +} + class RequiredTest :public QObject { Q_OBJECT @@ -4049,6 +4103,110 @@ void tst_Moc::requiredProperties() QVERIFY(!notRequired.isRequired()); } +class ClassWithQPropertyMembers : public QObject +{ + Q_OBJECT + Q_PROPERTY(int publicProperty NOTIFY publicPropertyChanged) + Q_PROPERTY(int privateExposedProperty) +public: + + QProperty<int> publicProperty; + QProperty<int> notExposed; + +signals: + void publicPropertyChanged(); + +protected: + QProperty<int> protectedProperty; + +private: + QProperty<int> privateProperty; + QProperty<int> privateExposedProperty; + QPropertyMemberChangeHandler<&ClassWithQPropertyMembers::publicProperty, &ClassWithQPropertyMembers::publicPropertyChanged> connector{this}; +}; + +void tst_Moc::qpropertyMembers() +{ + const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject; + + QCOMPARE(metaObject->propertyCount() - metaObject->superClass()->propertyCount(), 2); + + QCOMPARE(metaObject->indexOfProperty("notExposed"), -1); + + QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty")); + QVERIFY(prop.isValid()); + + QVERIFY(metaObject->property(metaObject->indexOfProperty("privateExposedProperty")).isValid()); + + ClassWithQPropertyMembers instance; + + prop.write(&instance, 42); + QCOMPARE(instance.publicProperty.value(), 42); + + QSignalSpy publicPropertySpy(&instance, SIGNAL(publicPropertyChanged())); + + instance.publicProperty.setValue(100); + QCOMPARE(prop.read(&instance).toInt(), 100); + QCOMPARE(publicPropertySpy.count(), 1); + + QCOMPARE(prop.metaType(), QMetaType(QMetaType::Int)); + + QVERIFY(prop.notifySignal().isValid()); +} + + + +void tst_Moc::observerMetaCall() +{ + const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject; + QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty")); + QVERIFY(prop.isValid()); + + ClassWithQPropertyMembers instance; + + int observerCallCount = 0; + + QProperty<int> dummy; + auto handler = dummy.onValueChanged([&observerCallCount]() { + ++observerCallCount; + }); + + { + void *argv[] = { &handler }; + instance.qt_metacall(QMetaObject::RegisterQPropertyObserver, prop.propertyIndex(), argv); + } + + instance.publicProperty.setValue(100); + QCOMPARE(observerCallCount, 1); + instance.publicProperty.setValue(101); + QCOMPARE(observerCallCount, 2); +} + + + +void tst_Moc::setQPRopertyBinding() +{ + const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject; + QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty")); + QVERIFY(prop.isValid()); + + ClassWithQPropertyMembers instance; + + bool bindingCalled = false; + auto binding = Qt::makePropertyBinding([&bindingCalled]() { + bindingCalled = true; + return 42; + }); + + { + void *argv[] = { &binding }; + instance.qt_metacall(QMetaObject::SetQPropertyBinding, prop.propertyIndex(), argv); + } + + QCOMPARE(instance.publicProperty.value(), 42); + QVERIFY(bindingCalled); // but now it should've been called :) +} + QTEST_MAIN(tst_Moc) // the generated code must compile with QT_NO_KEYWORDS diff --git a/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt new file mode 100644 index 0000000000..eaceac37b3 --- /dev/null +++ b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from qdbuscpp2xml.pro. + +##################################################################### +## tst_qdbuscpp2xml Test: +##################################################################### + +add_qt_test(tst_qdbuscpp2xml + SOURCES + test1.h + tst_qdbuscpp2xml.cpp + PUBLIC_LIBRARIES + Qt::DBus +) + +# Resources: +set(qdbuscpp2xml_resource_files + "test1.h" +) + +add_qt_resource(tst_qdbuscpp2xml "qdbuscpp2xml" + PREFIX + "/tst_qdbuscpp2xml/" + FILES + ${qdbuscpp2xml_resource_files} +) + diff --git a/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt new file mode 100644 index 0000000000..8095421637 --- /dev/null +++ b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from qdbusxml2cpp.pro. + +##################################################################### +## tst_qdbusxml2cpp Test: +##################################################################### + +add_qt_test(tst_qdbusxml2cpp + SOURCES + tst_qdbusxml2cpp.cpp +) diff --git a/tests/auto/tools/qmake/.prev_CMakeLists.txt b/tests/auto/tools/qmake/.prev_CMakeLists.txt new file mode 100644 index 0000000000..c1367ec18f --- /dev/null +++ b/tests/auto/tools/qmake/.prev_CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from qmake.pro. + +##################################################################### +## tst_qmake Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + testdata/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qmake + SOURCES + testcompiler.cpp testcompiler.h + tst_qmake.cpp + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qmake.pro:WIN32: +# testcase.timeout = "900" + +extend_target(tst_qmake CONDITION CMAKE_CROSSCOMPILING + DEFINES + QMAKE_CROSS_COMPILED +) + +extend_target(tst_qmake CONDITION CMAKE_BUILD_TYPE STREQUAL Debug AND debug_and_release + DEFINES + DEBUG_BUILD +) + +extend_target(tst_qmake CONDITION debug_and_release AND NOT CMAKE_BUILD_TYPE STREQUAL Debug + DEFINES + RELEASE_BUILD +) diff --git a/tests/auto/tools/qmake/CMakeLists.txt b/tests/auto/tools/qmake/CMakeLists.txt new file mode 100644 index 0000000000..994d5d47d1 --- /dev/null +++ b/tests/auto/tools/qmake/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from qmake.pro. + +##################################################################### +## tst_qmake Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + testdata/*) +list(APPEND test_data ${test_data_glob}) + +add_qt_test(tst_qmake + SOURCES + testcompiler.cpp testcompiler.h + tst_qmake.cpp + TESTDATA ${test_data} +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qmake.pro:WIN32: +# testcase.timeout = "900" + +extend_target(tst_qmake CONDITION CMAKE_CROSSCOMPILING + DEFINES + QMAKE_CROSS_COMPILED +) + +# special case begin +# remove this because it's not needed +#extend_target(tst_qmake CONDITION CMAKE_BUILD_TYPE STREQUAL Debug AND debug_and_release + #DEFINES + #DEBUG_BUILD +#) + +#extend_target(tst_qmake CONDITION debug_and_release AND NOT CMAKE_BUILD_TYPE STREQUAL Debug + #DEFINES + #RELEASE_BUILD +#) +# special case end diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 9b434a7b5b..7f98a0f5a0 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -318,6 +318,9 @@ void tst_qmake::subdirs() void tst_qmake::subdir_via_pro_file_extra_target() { + if (QProcessEnvironment::systemEnvironment().contains(QStringLiteral("QT_TEST_RUNNING_IN_CTEST"))) + QSKIP("This test does not run properly when invoked from CTest."); + QString workDir = base_path + "/testdata/subdir_via_pro_file_extra_target"; QDir D; diff --git a/tests/auto/tools/qmakelib/CMakeLists.txt b/tests/auto/tools/qmakelib/CMakeLists.txt new file mode 100644 index 0000000000..1e56c81e77 --- /dev/null +++ b/tests/auto/tools/qmakelib/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from qmakelib.pro. + +##################################################################### +## tst_qmakelib Test: +##################################################################### + +add_qt_test(tst_qmakelib + SOURCES + ../../../../qmake/library/ioutils.cpp + ../../../../qmake/library/proitems.cpp + ../../../../qmake/library/qmakebuiltins.cpp + ../../../../qmake/library/qmakeevaluator.cpp + ../../../../qmake/library/qmakeglobals.cpp + ../../../../qmake/library/qmakeparser.cpp + ../../../../qmake/library/qmakevfs.cpp + ../../../../qmake/library/registry.cpp + evaltest.cpp + parsertest.cpp + tst_qmakelib.cpp tst_qmakelib.h + DEFINES + PROEVALUATOR_FULL + PROEVALUATOR_SETENV + PROPARSER_DEBUG + INCLUDE_DIRECTORIES + ../../../../qmake/library +) + +## Scopes: +##################################################################### + +extend_target(tst_qmakelib CONDITION WIN32 + PUBLIC_LIBRARIES + advapi32 +) diff --git a/tests/auto/tools/rcc/CMakeLists.txt b/tests/auto/tools/rcc/CMakeLists.txt new file mode 100644 index 0000000000..06d62244ff --- /dev/null +++ b/tests/auto/tools/rcc/CMakeLists.txt @@ -0,0 +1,66 @@ +# Generated from rcc.pro. + +##################################################################### +## tst_rcc Test: +##################################################################### + +qt_add_test(tst_rcc + SOURCES + tst_rcc.cpp +) + +# Resources: +set(images_resource_files + "images/circle.png" + "images/square.png" + "images/subdir/triangle.png" +) + +qt_add_resource(tst_rcc "images" + PREFIX + "/" + BASE + "data/images" + FILES + ${images_resource_files} +) +set(size-0_resource_files + "data/data-0.txt" +) + +qt_add_resource(tst_rcc "size-0" + PREFIX + "/" + BASE + "data/sizes" + FILES + ${size-0_resource_files} +) +set(size-2-0-35-1_resource_files + "data/data-0.txt" + "data/data-1.txt" + "data/data-2.txt" + "data/data-35.txt" +) + +qt_add_resource(tst_rcc "size-2-0-35-1" + PREFIX + "/" + BASE + "data/sizes" + FILES + ${size-2-0-35-1_resource_files} +) +set(size-1_resource_files + "data/data-1.txt" +) + +qt_add_resource(tst_rcc "size-1" + PREFIX + "/" + BASE + "data/sizes" + FILES + ${size-1_resource_files} +) + diff --git a/tests/auto/tools/uic/CMakeLists.txt b/tests/auto/tools/uic/CMakeLists.txt new file mode 100644 index 0000000000..f7d91dccbe --- /dev/null +++ b/tests/auto/tools/uic/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from uic.pro. + +##################################################################### +## tst_uic Test: +##################################################################### + +add_qt_test(tst_uic + SOURCES + tst_uic.cpp +) diff --git a/tests/auto/tools/uic/baseline/browserwidget.ui.h b/tests/auto/tools/uic/baseline/browserwidget.ui.h index 7dcfb290f7..07142c5ea1 100644 --- a/tests/auto/tools/uic/baseline/browserwidget.ui.h +++ b/tests/auto/tools/uic/baseline/browserwidget.ui.h @@ -10,7 +10,7 @@ #define BROWSERWIDGET_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHBoxLayout> diff --git a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h index 220d44300b..43f83059d4 100644 --- a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h @@ -10,7 +10,7 @@ #define CHATMAINWINDOW_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QLabel> diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index fbbe81d0b8..bc9ad75858 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -10,7 +10,7 @@ #define DEFAULT_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h index df61d57ceb..1f375dd313 100644 --- a/tests/auto/tools/uic/baseline/mainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h @@ -10,7 +10,7 @@ #define MAINWINDOW_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h index a0594b7ec7..cc5f96982b 100644 --- a/tests/auto/tools/uic/baseline/pagefold.ui.h +++ b/tests/auto/tools/uic/baseline/pagefold.ui.h @@ -10,7 +10,7 @@ #define PAGEFOLD_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QComboBox> diff --git a/tests/auto/tools/uic/baseline/qttrid.ui.h b/tests/auto/tools/uic/baseline/qttrid.ui.h index 890ffc7789..cb5a4cb2e8 100644 --- a/tests/auto/tools/uic/baseline/qttrid.ui.h +++ b/tests/auto/tools/uic/baseline/qttrid.ui.h @@ -10,8 +10,8 @@ #define QTTRID_H #include <QtCore/QVariant> +#include <QtGui/QAction> #include <QtGui/QIcon> -#include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QGridLayout> diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h index 5b7c6c42c2..c5b72be860 100644 --- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h +++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h @@ -10,8 +10,8 @@ #define REMOTECONTROL_H #include <QtCore/QVariant> +#include <QtGui/QAction> #include <QtGui/QIcon> -#include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QGridLayout> diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h index 612d7ad427..3e1e7afbd3 100644 --- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h +++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h @@ -40,7 +40,7 @@ #define TRPREVIEWTOOL_H #include <QtCore/QVariant> -#include <QtWidgets/QAction> +#include <QtGui/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QDockWidget> #include <QtWidgets/QListView> |