summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-1711-29/+4
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add simple project generation based on existing source filesAlexey Edelev2023-02-0821-0/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the qt-cmake-create script. The script generates the simple CMakeLists.txt based on the source files located in the current or specified directory. The initial version can generate a CMake code for the following file types: - .c .cc .cpp .cxx .h .hh .hxx .hpp - generates the qt_add_executable call with prerequisites. - .qml .js .mjs - generates the qt_add_qml_module call with prerequisites. - .ui - adds the found ui files to the existing executable. Requires C++ files be present in the directory too. - .qrc - generates the qt_add_resources call and adds the resources to the existing executable. Requires C++ files be present in the directory too. - .proto - generates qt_add_protobuf call with prerequisites. The QtInitProject.cmake script contains the 'handle_type' function that allows extending the script capabilities and establish simple relation chains between the file types. Note: The initial implementation doesn't deal with sub-directories, so all files from sub-directories will be added to and handled in the top-level CMakeLists.txt file. This can be extended by user request. Task-number: QTBUG-104388 Change-Id: I5abd9e07da109e867ff95986572ed2bf02ef9d3d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qdbusxml2cpp: don't emit Q_DECL_DEPRECATED for the adaptorThiago Macieira2023-02-071-3/+3
| | | | | | | | | | | | | | | The adaptor is a server-side implementation that must exist anyway and is called by the QtDBus runtime. We don't want warning on the server side because it must call those methods to implement the client API. Since we have the XML introspection saved in a class property anyway, the runtime won't be inspecting the method tags to see if Q_DECL_DEPRECATED is there, to add to the XML (which it isn't generating). Pick-to: 6.5 Change-Id: I9671dee8ceb64aa9b9cafffd17416596135d26ca Reviewed-by: David Faure <david.faure@kdab.com>
* qdbusxml2cpp: invert Q_DECL_DEPRECATED and inline in the outputThiago Macieira2023-02-071-0/+49
| | | | | | | | | | | | | | | | Commit 93dad2bf91d414a41c6e2c7db6c75171b4917d4d (6.0) changed Q_DECL_DEPRECATED to use the [[deprecated]] attribute, which must appear before inline and other keywords. To keep it next to Q_NOREPLY, I also moved the "inline" into the next string. Added missing tests for both. Pick-to: 6.2 6.4 6.5 Fixes: QTBUG-110979 Change-Id: I9671dee8ceb64aa9b9cafffd1741656e86f40453 Reviewed-by: David Faure <david.faure@kdab.com>
* tst_qdbusxml2cpp: test the old-style QDBusReply interface output tooThiago Macieira2023-02-071-1/+2
| | | | | | Pick-to: 6.2 6.4 6.5 Change-Id: I9671dee8ceb64aa9b9cafffd17416487c07f148a Reviewed-by: David Faure <david.faure@kdab.com>
* moc: Allow calling ctors on pre-allocated dataUlf Hermann2023-02-021-0/+37
| | | | | | | | | | | | When calling a ctor this way, an object is created in the memory pointed to by _a[0] using the other arguments for the ctor. This allows separate allocation and initialization of an object through the metaobject system. Fixes: QTBUG-108879 Change-Id: Ifb154373ee42faab281cfb62aa14334980ec6b7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* RCCFileInfo: get lastModified file time in UTC directlyAhmad Samir2023-01-051-1/+1
| | | | | | | | | These are time stamps, and they use toMsecsSinceEpoch(), no point getting the time in Local time zone then converting it. Change-Id: I2db2db5f9ebc062e65514a592fa7fa00cf1d179d Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* dbus: Fix path to moc file in generated qdbusxml2cppDavid Edmundson2022-12-161-2/+8
| | | | | | | | | | | | | | | | qdbusxml2cpp takes a filename to use for generated output. It may be in the form 'name.cpp' or just 'name'. For the moc file we need to convert this from a path to a name of a file in the same relative folder. It's not uncommon for this name to contain dots as sometimes a dbus interface name is used directly. For the cases where a suffix is not provided the whole name should be used. Pick-to: 6.5 Change-Id: I3bf4ae8b2b9121184c2786009e8b5abcc5e3e410 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: Output the "cloned" flag for methodsUlf Hermann2022-11-274-0/+56
| | | | | | | | | We will need it in QML to determine which signal out of a number of "overloads" to generate handlers for. Task-number: QTBUG-108762 Change-Id: Ib73eeb59dbf037bd03faf0d841860d9ebc9e7032 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-032-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tests: fix configuring with -no-feature-guiJohannes Kauffmann2022-10-291-1/+2
| | | | | | Pick-to: 6.2 6.4 Change-Id: I99765d38c9c37f1fe17b15f7736e4c78c7ffac20 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* moc: Add basic support for nested inline namespacesFabian Kosmale2022-09-261-0/+9
| | | | | | | | | | | | | | | This improves moc's support for nested inline namespaces, so that code containing them will not break compilation. For simplicity, we allow nested inline namespaces even in C++17 mode (the actual C++ compiler will reject the code anyway, and probably with a better error message than moc could output). moc still has no real awareness how inline namespaces work, but that is a preexisting issue. Pick-to: 6.4 6.2 Fixes: QTBUG-106920 Change-Id: I7b415a99133575f101bc81d01d4670a5f752917f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* moc: Do not fail to compile meta-methods containing non-const ref typesFabian Kosmale2022-09-212-0/+21
| | | | | | | | | | | | | | | | Amends 2d0c31e7d92a3e9df4ce2b9c1d41b94fb12735fc. We were using MetaTypeDecay in qTryMetaTypeInterfaceForType; but that is not used by moc when complete types are enforced. Change qt_metaTypeArray to also use qTryMetaTypeInterfaceForType, so that the code path for "force complete types"[0] and the normal one do not diverge. [0] Most easily enabled by using one of the QML type registration macros. Fixes: QTBUG-106672 Pick-to: 6.4 6.4.0 Change-Id: I9bf14873d1d0c4127a676643f7e8eb77f6e42dc8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qdbusxml2cpp: modify the behavior of -m/--moc optionMate Barany2022-09-061-27/+88
| | | | | | | | | | | | | | | | | | | | | | | | qdbusxml2cpp has a -m/--moc option. Change and modify the behavior such that -p foo -m includes moc_foo.cpp in the generated .cpp -p :foo.cpp includes moc_foo.cpp in the generated .cpp -p foo.h:foo.cpp includes moc_foo.cpp in the generated .cpp Change the Qt6DbusMacros.cmake file accordingly. [ChangeLog][qdbusxml2cpp] The -m/--moc option now generates idiomatic moc file names (moc_base.cpp for headers, base.moc for implementation files)(was: always base.moc). Build systems using workarounds for the non-idiomatic naming of moc files used by qdbusxml2cpp in the past can now drop these workarounds for Qt versions >= 6.5. Fixes: QTBUG-103313 Change-Id: I754b1b276f130cb8645166470e1b457a676590f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2312-12/+12
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* qdbusxml2cpp: remove the old "In"-for-signal compatibility codeThiago Macieira2022-08-161-30/+104
| | | | | | | | | | | | | | | This led to an infinite recursion in case the annotation was completely missing. Instead of trying to fix that, I'm simply implementing the "### Qt6" request from c62f71722639c39f210ddbec0c4d832521b3f187 . [ChangeLog][qdbusxml2cpp] Removed the old compatibility code that accepted "In" annotations for signal argument names, introduced in Qt 5.8. Pick-to: 6.4 Fixes: QTBUG-104722 Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d Reviewed-by: David Faure <david.faure@kdab.com>
* moc: handle attributes in class declarationsFabian Kosmale2022-08-031-1/+1
| | | | | | | | | | | | We already had code to handle attributes on funtcions, but we didn't handle them correctly for classes so far. Fix this by simply skipping over the attribute. Fixes: QTBUG-105310 Pick-to: 5.15 6.2 6.3 6.4 Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add license headers to cmake filesLucie Gérard2022-08-0312-0/+36
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QMetaType: fix void* parametersThiago Macieira2022-08-012-1/+77
| | | | | | | | | | | | | Commit 3695b35dfc427f274e55f8e2a6a9876deb52f1b4 accounted for pointer to other incomplete types, but pointer-to-void was missed. This caused an inconsistency in the stored metatype for void*, which is a built-in type (QMetaType::VoidStar) but no pointer was recorded. The test in tst_moc hadn't been enabled because the functions in questions weren't extracted by moc. That is fixed in this commit. Change-Id: I6f936da6f6e84d649f70fffd1706f613517a75fb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-284-9/+9
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* moc: Allow writing properties through bindablesUlf Hermann2022-07-081-21/+58
| | | | | | | | | | | | | BINDABLE should generally behave the same as MEMBER if "WRITE default", except where it cannot. In particular we cannot know if any NOTIFY signal should be sent from the synthetic WRITE accessor. [ChangeLog][QtCore] moc will now synthesize WRITE accessors for properties with BINDABLE if you specify "WRITE default". Task-number: QTBUG-97249 Change-Id: I883c40ba0dda7989c840971860addaeaa75a8c83 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* rcc: Suppress clang's -Wexit-time-destructorshjk2022-07-074-0/+36
| | | | | | | | | | | | | | It's an opt-in warning that some people like to use. It was introduced to clang 3.0.0 in 2011 by https://github.com/llvm/llvm-project/commit/98766db7858379f61d24d5d93b1b7be39fda0913 However, the feature is intentionally used here and the generated code is legit. Make both sides happy. Change-Id: I79335cd3a6a6cc128fa65f77d201a12f67424260 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qdbusxml2cpp: allow choosing <> over ""Mate Barany2022-07-071-0/+49
| | | | | | | | | | | | | | | | | | | | qdbusxml2cpp's -i option uses "" for the includes. However, an option to include with <> would be also desirable, since some compilers may use a different search strategy for <> than for "". Add a new command line option -I/--global-include to include the given argument using <>. The new option will be used in qtconnectivity. [ChangeLog][qdbusxml2cpp] Added command line option -I/--global-include to include header files with <> in the generated files. Fixes: QTBUG-103362 Change-Id: If8e7f8b86440bdec53f2517db1ad460912664b20 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_moc: fix build with GCC 12Thiago Macieira2022-06-241-3/+3
| | | | | | | | | | | | | You can't mismatch the export macros. The QT_MOC_EXPORT_PLUGIN_V2 macro defines these functions as Q_DECL_EXPORT so they can be found by QPluginLoader. We must match the macro here, otherwise GCC 12 complains (tst_moc.cpp is compiled with -fvisibility=hidden): tst_moc.cpp.o: non-canonical reference to canonical protected function `qt_plugin_instance' in moc_plugin_metadata.cpp.o Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f99893d5730da5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* moc: fix use of escape sequence of more than one characterThiago Macieira2022-06-221-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had the code to calculate the length, but were improperly using it only for the offset, not the length of the string or its containing array. That resulted in the generated moc output containing: QT_MOC_LITERAL(111, 5), // "\xffz" QT_MOC_LITERAL(114, 5), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The two strings are described as occupying 5 bytes (length 4 + null terminator), which is incorrect. The offset was correct: 114 - 111 = 3 and 117 - 114 = 3. The new output is: QT_MOC_LITERAL(111, 2), // "\xffz" QT_MOC_LITERAL(114, 2), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The effect of the array size calculation would only be felt if moc decided it needed a second string array (for strings over 65535 bytes), which would cause the offsets in the second array to be all wrong. There was no such test until now. Drive-by fixing of the newline, indentation, and the stale comment referring to QByteArrayData (Qt 5). Pick-to: 6.2 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: Allow reading property values through bindablesUlf Hermann2022-06-221-0/+39
| | | | | | | | | | | | | The behavior is similar to MEMBER: If the READ accessor is "default", synthesize it using the bindable. [ChangeLog][QtCore] You can now specify "READ default" in a Q_PROPERTY if you also specify a BINDABLE. moc will synthesize a READ accessor in that case. Task-number: QTBUG-97249 Change-Id: I4a275adabaed12df95dac505095f847c4be65dfe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Teach qmake about digit-grouping apostrophes in numeric literalsEdward Welbourne2022-06-173-3/+16
| | | | | | | | | | | | | It was previously understanding them as character literal delimiters, with unfortunate consequences if a numeric literal contained an odd number of them. Recognize that an apostrophe with a digit on each side of it isn't the opening quote of a character literal (unless the digit before it is preceded by a u). Extend the findMocs test to trigger the bug, prior to the fix; verified it passes with the fix. Fixes: QTBUG-98845 Change-Id: I5db3ac59aaeade7c2d6c1fb680ba97261ec0e8a9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Make uic generate correct C++ commentsVolker Hilsheimer2022-05-1851-102/+177
| | | | | | | | | Revert the change to uic of 05fc3aef53348fb58be6308076e000825b704e58. Task-number: QTBUG-67283 Change-Id: Icfd83bb6d80b91d4e58f1be460f6772ba49a6921 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-16186-5071/+457
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* uic: use C string literals for setObjectName()Marc Mutz2022-03-18108-1557/+1557
| | | | | | | | | | | | | | | | | | | | | | Because setObjectName() now takes a QAnyStringView, passing C string literals is much more efficient than using QString::fromUtf8(). This patch only deals with setObjectName() as a known property, probably from a name attribute. If the objectName property is set by a <property> element (or so I assume), we still emit a QString::fromUtf8(). Detecting objectName there would be too much magic. Besides, I haven't been able to find why sometimes there's a second setObjectName call right after the first, when in the XML it seems all kosher (name attribute and objectName <property> agreeing on the content). Change-Id: Icf07bad841ac735a9c744bbd955428ba15758089 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add VERBATIM option to add_custom_command callsAlexey Edelev2022-03-171-0/+1
| | | | | | | | | | | Use VERBATIM option to prepare the correct command line for the add_custom_command. This especially sensitive when using build directories with names containing special symbols, that cannot be handled by shell correctly. Change-Id: I51d7041cb806411135fd59bf6273c04a3c695443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Deprecate {QString, QByteArray}::count()Sona Kurazyan2022-03-121-2/+2
| | | | | | | | | | | | And remove their uses. [ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count() and QByteArray::count() that take no parameters, to avoid confusion with the algorithm overloads of the same name. They can be replaced by size() or length() methods. Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* typeNameForCast: use add_pointer instead of string manipulationFabian Kosmale2022-02-181-0/+13
| | | | | | | | | | | | | | Relying on string manipulation leads to -Wredundant-parens warnings in the best case, and to non-compiling code (when using typedefs) in the worst case. We can avoid both issues by simply generating code that uses add_pointer, which takes care of reference types (even typedef'd ones), and creates no warnings about parens (as we don't write any anymore). Fixes: QTBUG-100915 Pick-to: 6.3 6.2 Change-Id: Ic5b1cbfda20d920d11f51beeb62e9479261d5f00 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add missing implicit dependencies to the tool testsAlexey Edelev2022-02-094-11/+34
| | | | | | | | | | | | | moc, qmake, rcc, and uic tests execute corresponding tools inside the test executables. This adds dependencies explicitly, to execute tests using _check targets, without the need to manually build dependencies. Pick-to: 6.3 6.2 Fixes: QTBUG-98576 Change-Id: I8b989276e21199b867591f7b0f6af9204695ac13 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Exclude tst_qmake if the build of qmake tool is disabledAlexey Edelev2022-02-091-1/+3
| | | | | | Pick-to: 6.2 6.3 Change-Id: I5aadf5250c19d8a8b26c4a890350ff3bf79e31c7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* rcc: Fix missing IGNORE directive for Qt version in tst_rccAlexandru Croitor2022-01-311-1/+1
| | | | | | | | | | | | | The IGNORE directive was likely removed as an oversight in the linked change. This fixes the test to pass when bumping the Qt version. Amends 9836dbd6ee7860d69c85e64db3dabc3382635d61 Change-Id: I497325d6d8b8b67cce7b0840bfb9bfa70d85fe73 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-171-5/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QHash: increase minimum buckets to a full spanLars Knoll2021-12-137-97/+97
| | | | | | | | | | | | | | Change the minimum amount of buckets to be at least 128, ie. one full Span. This will simplify some assumptions in the code. Regeneration of rcc test-data needed because the extra buckets causes the order of the keys to change. Task-number: QTBUG-91739 Task-number: QTBUG-98436 Change-Id: Ic0c7da03570cc4c4e6aacc9645e536aec3667a98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live Q_GADGET_EXPORT!Marc Mutz2021-11-271-2/+24
| | | | | | | | | | | | | | | | | | | | | | Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET allows passing an export macro. This is useful to avoid exporting the whole class just to get the staticMetaObject hidden therein exported. Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject subclasses, being polymorphic, always need to have a class-level export macro (to export their vtable), but while that technique also works for value classes (the Q_GADGET audience), it is not desirable for them, because it makes inline functions exported in Windows debug builds, which is not what we want, because it needlessly restricts what you can to with the inline functions (e.g. remove). [ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT for Q_NAMESPACE). Fixes: QTBUG-55458 Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move macdeployqt and windeployqt from qttools to qtbaseJoerg Bornemann2021-11-2314-0/+718
| | | | | | | | Having all *deployqt tools in qtbase will allow us to couple deployment support more tightly with the build system. Change-Id: I299efdacfa6b66a303bb3996ff3ff84e723210a5 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* uic: Fix missing Python import when setting tab ordersFriedemann Kleint2021-10-201-1/+1
| | | | | | | | | Add QWidget as default import so that QWidget.setTabOrder() is found. Pick-to: 6.2 Change-Id: I7593008d1395e3fddacf7124d271a0eaf4c345d9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-2/+2
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QPlugin: add qt_plugin_query_metadata_v2() to dynamic pluginsThiago Macieira2021-10-111-11/+2
| | | | | | | | | | They return a pointer to the actual header, skipping the magic string. This is done in preparation for the header located in an ELF note, which won't have the magic. Change-Id: I3eb1bd30e0124f89a052fffd16a8229bec2ad588 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlugin: suppress the "QTMETADATA !" magic in static pluginsThiago Macieira2021-10-111-12/+10
| | | | | | | | | | | | | | | | The .qtmetadata section is already suppressed for static plugins, but we carried this unnecessary magic string. For library file formats where we don't have a scanner (Windows COFF PE), a library that linked multiple static plugins could end up with multiple metadata found. We can't suppress the header because the version of moc could be different to the version of Qt, so we need to read the header version too. Right now, the version isn't output by moc (all the logic is in qplugin.h), but this could change again in the future. In any case, 4 extra bytes are not a big deal, so the header stays. Change-Id: I3eb1bd30e0124f89a052fffd16a82088d8303081 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Support QNX QCC compilerPasi Petäjäjärvi2021-09-161-2/+2
| | | | | | | | | | | tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::os9Newline()': qtbase/tests/auto/tools/moc/tst_moc.cpp:1225: undefined reference to `Os9Newlines::staticMetaObject' tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::winNewline()': qtbase/tests/auto/tools/moc/tst_moc.cpp:1239: undefined reference to `WinNewlines::staticMetaObject' Pick-to: 6.2 Change-Id: I629d67c1190e09b26dc09e41cb7170cb0eadf1cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: Support BINDABLE for private propertiesAndrei Golubev2021-08-061-0/+11
| | | | | | | | Hopefully we won't need it but let's have it still at least for consistency Change-Id: I72289e65e5e5613174ad4d98cf8d614f9caae8e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Handle even more include in enum casesFabian Kosmale2021-08-061-0/+5
| | | | | | | | | | | | | | The solution in d3ed7dac8aa2f4ede0c409254b9dd44842086be0 was needlessly complicated, and broke a valid use case. The issue of no identifier being available to parse after the include has been processed can instead be solved by moving the test for the closing brace after the include processing. Fixes: QTBUG-94790 Pick-to: 6.2 6.1 5.15 Change-Id: Ieec4b89e1d117637f11479e8bddc4060f93da43d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* testlib: Deprecate QWARN() in favor of qWarning()Tor Arne Vestbø2021-08-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The QtTest best practices documentations recommends using output mechanisms such as qDebug() and qWarning() for diagnostic messages, and this is also what most of our own tests do. The QWARN() macro and corresponding internal QTest::qWarn() function was added when QtTest was first implemented, but was likely meant as an internal implementation detail, like its cousin QTestLog::info(), which does not have any corresponding macro. This theory is backed by our own QtTest self-test (tst_silent) describing the output from QWARN() as "an internal testlib warning". The only difference between QWARN() and qWarning(), besides the much richer feature set of the latter, is that qWarning() will not pass on file and line number information in release mode, but QWARN() will. This is an acceptable loss of functionality, considering that the user can override this behavior by defining QT_MESSAGELOGCONTEXT. [ChangeLog][QtTest] QWARN() has been deprecated in favor of qWarning() Pick-to: 6.2 Change-Id: I5a2431ce48c47392244560dd520953b9fc735c85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDirIterator: add nextFileInfo()Marc Mutz2021-07-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | Before this change, next() was the only way to advance the iterator, whether the caller was ultimately interested in just the filePath() (good) or not (bad luck, had to call .fileInfo()). Add a new function, nextFileInfo(), with returns fileInfo() instead. Incidentally, the returned object has already been constructed as part of advance()ing the iterator, so the new function is faster than next() even if the result is ignored, because we're not calculating a QString result the caller may not be interested in. Use the new function around the code. Fix a couple of cases of next(); fileInfo().filePath() (just use next()'s return value) as a drive-by. [ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like next(), but returns fileInfo() instead of filePath(). Change-Id: I601220575961169b44139fc55b9eae6c3197afb4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>