summaryrefslogtreecommitdiff
path: root/src/assistant
Commit message (Collapse)AuthorAgeFilesLines
* Fix static analysis/clazy warnings about QString::arg()/multiFriedemann Kleint2023-05-031-2/+1
| | | | | | | | In some cases, remove QString::number() for int. Pick-to: 6.5 Change-Id: I60260afbbb3045448025983e37974667f2eeb51a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QHelpCollectionHandler: Fix static analysis warning about const-signalsFriedemann Kleint2023-05-032-3/+4
| | | | | | Pick-to: 6.5 Change-Id: I422dc9df9dfcbafbdde99708692e4b59d112e99e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* assistant: Remove unused network dependency from help/qhelpgeneratorJimi Huotari2023-04-192-2/+0
| | | | | | | | | It seems the Qt Network libraries are not required for the Help module, nor the qhelpgenerator tool. Change-Id: I4c08c052a6daa62e65357ecc1f452ee150cd6172 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Compute initial size for assistant main window correctlyMikolaj Boc2023-03-281-2/+2
| | | | | | | | | | | | | | Resizing to 4/5 of screen dimensions was previously followed by calling adjustSize(), which immediately overrides the size assigned to the minimum size that accommodates child widgets. Reversing the calls makes us both not start outside the screen as intended and sets the correct size of 4/5 of screen real estate. Fixes: QTBUG-112220 Pick-to: 6.5 Change-Id: I7439ee35bb07f448372fbf2f3943475db7095ac5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update Copyright year to 2023Kai Köhne2023-03-211-1/+1
| | | | | | Pick-to: 5.15 6.2 6.4 6.5.0 6.5 Change-Id: I62921a04d2173dcd78797d792437a27bbaafc5c7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Report QLiteHtmlWidget in Assistant's About dialog if usedShawn Rutledge2023-02-281-2/+4
| | | | | | | | | | | | | | It has been confusing for several releases that the About dialog kept saying it's using QTextBrowser. I can't find any evidence that there's even any code to instantiate a HelpViewerImpl right now. Amends 6e7ef34e6c8a2bd130fd5305e4b41fc8b11100a3 which removed the call "new HelpViewerImpl" in the HelpViewer ctor. Pick-to: 6.2 6.4 6.5 Task-number: QTBUG-92267 Change-Id: Ieed2cf3237a07772152f179b9a82a2e35bfed0ee Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Force BUILD_TESTING to OFF for qlitehtmlAlexey Edelev2023-02-211-0/+1
| | | | | | | Fixes: QTBUG-111091 Change-Id: Ia9c2503d4304f9d8223151f9fc07f94cf8855527 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update qlitehtml moduleKai Köhne2023-02-171-0/+0
| | | | | | | | | | | [ChangeLog][Third-Party Code] Litehtml (used in Qt Assistant) was updated to upstream version v0.6. Fixes: QTBUG-110353 Pick-to: 6.5 Change-Id: Ib67936cd4493ff84d247fa241a1cc4ef641cf752 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-084-23/+2
| | | | | | Pick-to: 6.5 Change-Id: Ic00df7d45246270d724b3b1d1ef9d13d76dcc136 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* HelpEngineWrapper: fix API susceptible to GCC 13 -Wdangling-referenceMarc Mutz2023-01-262-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | GCC 13 currently assumes that the temporary argument (the default value) ends up embedded in the result, and warns: helpviewer.cpp:393:34: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 393 | const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); | ^~~~~~~~~~ helpviewer.cpp:393:74: note: the temporary was destroyed at the end of the full expression ‘Qt6::HelpEngineWrapper::instance(Qt6::QString())’ 393 | const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ An attempt to fix the issue by passing the QString by value made it worse, as all calls threw the warning then, including those that pass a QString instead of relying on the defaulted argument. So, heed QTBUG-98117 and overload instead of using default arguments. Having the nullary overload in the same TU as the unary one seems to make GCC shut up about the False Positive dangling. Task-number: QTBUG-98117 Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I69da70dfbf996ab923078631031f6f3c7a5cfcbe Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Assistant: Deduplicate helper buildQUrl()Friedemann Kleint2023-01-133-14/+6
| | | | | | | | | It causes clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I40ae560ff7e15aa8240736fe9bca14e756a67716 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Assistant: port HelpEngineWrapper from QSharedPointer to unique_ptrMarc Mutz2023-01-021-11/+18
| | | | | | | | | | | | | | | The only reason why the code used a shared instead of a unique ptr, apart from possibly predating C++11, is that the container in which the pointer is held, QMap, doesn't support move-only types. Now that QMap is but a wrapper around std::map, use the Real Thing™, and gain move-only type support for free. Replace a QPair with a proper struct with named members. Pick-to: 6.5 6.4 Change-Id: Ic8d5529c5b03fa570553c8f81d7f9a721a167246 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Assistant: use QDateTime::currentDateTimeUtc()Marc Mutz2023-01-021-1/+1
| | | | | | | | | | | | ... instead of currentDateTime(). Apart from avoiding certain false results twice a year, during DST transition times, the UTC version is also orders of magnitude faster than the local-time version. Pick-to: 6.5 6.4 Change-Id: I4330e51217c86dc9b073505c971ba99a74629fb7 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Update qlitehtml submoduleKai Köhne2022-10-191-0/+0
| | | | | | | | | Include bd70f93Add missing license files Pick-to: 6.4 Change-Id: I5927443148cadd2b9a9909ca94d8024b45d1f942 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-102-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Update qlitehtml to a version w/o qAsConstMarc Mutz2022-10-101-0/+0
| | | | | Change-Id: I796141c23051637713b22a326c6c655947cb6dae Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-066-19/+19
| | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I234704ba429750ddee958a82f6c941d041da0653 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-0624-65/+65
| | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), 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', with the extended set of container classes recognized. Change-Id: I95f6410e57a6a92b1cf91bbedfbe3d517cab6b44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update qlitehtml to newer stateJarek Kobus2022-09-161-0/+0
| | | | | | | | Fixes: QTBUG-106552 Pick-to: 6.4 6.3 6.2 Change-Id: I7efba75e3cd20e373c3407a6dfe454f8a4cce563 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Assistant: temporary un-deprecate QHelpEngineCore APIsIvan Solovev2022-08-311-4/+4
| | | | | | | | | | That is needed to enable the builds with QT_DISABLE_DEPRECATED_UP_TO. The APIs were deprecated in Qt 5.13, but the replacing code is not yet complete. Fixes: QTBUG-104968 Change-Id: I2f21250d5071b60dc5040ea4e186c66af2939e3c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-254-4/+4
| | | | | | Task-number: QTBUG-105718 Change-Id: I2df3a8aec11f30f301e3143e9960156b6f45e614 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix several more improperly placed #include mocThiago Macieira2022-08-171-2/+2
| | | | | | | | | | | | | Like commit qtbase/638893bea083b619b73b33a7dd5589fb2c4c4242. Script to find them: git grep -l '#include.*moc' \*.cpp \*.mm | \ xargs awk '/QT_BEGIN_NAMESPACE/ { i=1 } /QT_END_NAMESPACE/ { i=0 } /#include.*moc/ && i { print ARGV[ARGIND], $0 }' Pick-to: 6.4 Change-Id: I6f936da6f6e84d649f70fffd17058fd05cfc5c6d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-024-0/+12
| | | | | | | | | | | | 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: I41a2c9aa6a933a4e3dda5d5b4c70c461912907b2 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix build with system litehtml and gumboAlexandru Croitor2022-07-251-3/+11
| | | | | | | | | | | | | We can't set compiler flags on already built targets. Only set them conditionally on if the targets are available in the assistant subdirectory scope. They will only be available there when litehtml is built as part of qttools itself. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-105130 Change-Id: Ie56ecf2b453d03147dde95aa04434a988febd4da Reviewed-by: Moody Liu <mooodyhunter@outlook.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QHelpIndexWidget: guard the usage of deprecated signalsIvan Solovev2022-07-211-0/+4
| | | | | | | | | ... so that we could compile the code with QT_DISABLE_DEPRECATED_BEFORE Task-number: QTBUG-104968 Pick-to: 6.4 6.3 6.2 Change-Id: Iee39a3a5af51b6f9b02fa0eccac3f15aaceb778d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Assistant: guard deprecated method definitionsIvan Solovev2022-07-212-0/+10
| | | | | | | | | | | The definitions of the deprecated methods were not guarded by the QT_DEPRECATED_SINCE() check, which causes compilation errors when trying to get rid of the deprecated APIs using QT_DISABLE_DEPRECATED_BEFORE. Task-number: QTBUG-104968 Pick-to: 6.4 6.3 6.2 Change-Id: Ifa44058f866e000ace75046a850906e170d04731 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Doc: Do not advertise Qt module includeKai Köhne2022-07-213-13/+0
| | | | | | | | | People should rather use class includes, like they are advertised in each class documentation. Pick-to: 6.4 Change-Id: Ic0d24553432a02212feb63e25eb8695a374604fc Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for executablesAlexandru Croitor2022-07-212-2/+2
| | | | | Change-Id: Ibe5d2ed0b632ffff4a8a1e24e95500f80a742191 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Add qtgui dependency to qthelpLuca Di Sera2022-06-221-1/+1
| | | | | | | | | | | | | The documentation for qthelp defines the "helpsystem" group. Some member of those group are declared in qtgui, such that for the qthelp documentation to correctly generate the member list for the "helpsystem" group a dependency to qtgui is required. Hence, the dependency was added. Change-Id: Icb11e82bcd0a352c936b08387a061436874f934a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix qhelpgenerator for static top-level buildsJoerg Bornemann2022-06-221-3/+13
| | | | | | | | | | | | This tool needs the QSQLiteDriverPlugin in addition to the QMinimalIntegrationPlugin. Update the code that imports the plugins. This amends commit 0412da38b3d00ca4a192b0d262ad5b0e35b51503. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104490 Change-Id: I6b26b7081113e8036336cd2e19dab896f4956a3f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix typoKai Köhne2022-06-221-1/+1
| | | | | | Pick-to: 6.4 Change-Id: Iad35cbe157b10bd7636186c8a27d7381fdbfe043 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Ensure FileAttributeSetTable is filled ordered so we get the same qch file ↵Albert Astals Cid2022-06-191-1/+3
| | | | | | | | | | each time This is part of making all of Qt reproducible Change-Id: I1a4120cab6844887fb4b48edb238b8f1b55f0eb9 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update qlitehtmlJarek Kobus2022-06-151-0/+0
| | | | | | | | | The new head contains a fix for pageUp/Down keys issue. Pick-to: 6.4 6.3 Fixes: QTBUG-100837 Change-Id: I61631133b96a7bfebd196ef8f8e4bca6d3071990 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove unused iconsFriedemann Kleint2022-06-073-2/+0
| | | | | | Change-Id: I393b7bccbc7c7de9c303af469e865b2ad7502dc2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-19134-4233/+266
| | | | | | | | | | | 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: I5335388c0472b0ee554234fc7eca60769e504660 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix qhelpgenerator to run in static buildsAlexandru Croitor2022-03-211-4/+27
| | | | | | | | | | | | | | | | | | Explicitly link to the minimal qpa plugin, because qhelpgenerator expects it to be available. Unfortunately we have two implement it in two different ways, depending on whether it's a top-level build or not. In a per-repo build, we can rely on using qt_import_plugins. In a top-level build we have to manually create a source file to initialize the plugin and link to the plugin manually. Pick-to: 6.2 6.3 Fixes: QTBUG-93238 Change-Id: If9cac4a60d5a6632f2b33c6748d62ca462b1e022 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Compile without warning after QString::count deprecationVolker Hilsheimer2022-03-211-4/+4
| | | | | | Pick-to: 6.3 Change-Id: Ie3a3f8833bf88716f3b13540e74ea7800c07234c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix warning when building assistant on macOSVolker Hilsheimer2022-03-181-2/+2
| | | | | | | | Follow up on QWidget::addAction changes in qtbase. Pick-to: 6.3 Change-Id: I997e0597999b7dd8ba3cbbc1e955593effff829c Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tools: do not rely on transitive includesFabian Kosmale2022-03-186-0/+8
| | | | | Change-Id: Ib78f984827988a39f56c4423eae40c67797549ea Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix qttools build after include cleanup in qtbaseVolker Hilsheimer2022-03-184-0/+4
| | | | | | | | QMap and QHash need to be explicitly included. Pick-to: 6.3 Change-Id: I43de3cdf0911c5ed5d86a2107c15cc32d94da30a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qhelpgenerator: Fix infinite loop issue in checkLinksVenugopal Shivashankar2022-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | The while loop that looks for the next match, depends on the offset to move to the next match. Even before this offset is updated, the loop is continued if the first capture group of the `linkPattern` regex contains the sequence "://", making the loop to iterate over the same match. Getting all the matches at once and iterating over them is probably a better alternative. Amends 85803440b28aadd3f4fe3e99a52e52378671b9e0 Pick-to: 6.2 6.3 Fixes: QTBUG-101070 Change-Id: I0acd4428244398ccfbb88e042229a928c234b951 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Assistant: remove unused private includeThiago Macieira2022-02-141-1/+0
| | | | | | | | Assistant does not link to Qt::HelpPrivate Change-Id: I74249c52dc02478ba93cfffd16d2924f0a6ec259 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix deprecated QMenu::addAction() overloadsFriedemann Kleint2022-02-012-12/+12
| | | | | | | | | Amends qtbase/0e02f6536acb721a55af12c11fef27299b354d24. Fixes: QTBUG-100357 Pick-to: 6.3 Change-Id: I51869f8fbc111232784e41db642db8a152b7aa52 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Assistant: Fix Werror=suggest-override warningKai Köhne2022-01-201-1/+1
| | | | | | | | | | Fixes MinGW/gcc warning qttools/src/assistant/assistant/stdinlistener_win.h:49:10: error: 'virtual void StdInListener::run()' can be marked override [-Werror=suggest-override] Pick-to: 6.2 6.3 Change-Id: Id4be15e82811630ab26942c9d889abe1685e083a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-182-48/+0
| | | | | | | Task-number: QTBUG-94446 Change-Id: I4b57f84f7c817989955d2088a6314d4194f4995d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Bump copyright year to 2022Kai Köhne2022-01-051-1/+1
| | | | | | | | Pick-to: 6.2 Pick-to: 6.3 Pick-to: 5.15 Change-Id: I1b3f0d1b84f507e45728a00fa652d0db936cebca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Install qhelpgenerator in libexecJoerg Bornemann2021-11-081-0/+1
| | | | | | | | This tool is not meant to be run by users and should reside in libexec. Task-number: QTBUG-88791 Change-Id: I1ae384d2ac803b3d6ac6f24cf7a3e36ea5919528 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update litehtml moduleJarek Kobus2021-11-011-0/+0
| | | | | | | | Incorporates 4931b7aa30f256c20573d283561aa432fecf8f38. Pick-to: 6.2 Change-Id: I249f42bc4db94f3b09f4d872a61c1bf2d12e9af3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Update qlitehtml submodule to the last versionJarek Kobus2021-10-271-0/+0
| | | | | | | | | It should fix the issue when compiling sources with conan. Pick-to: 6.2 Task-number: QTBUG-97765 Change-Id: I376cdb1693336352094d07664c5123b83eaf1218 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Update qlitehtml submodule to incorporate the fix for broken shortcutsJarek Kobus2021-10-201-0/+0
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-97189 Change-Id: I7bce6f9d1fe7f42c254c41705f483e6ad7758e0d Reviewed-by: Eike Ziller <eike.ziller@qt.io>