aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljsplugindumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Fix build with MSVC with C++20Eike Ziller2024-02-281-1/+1
| | | | | | | | | | | | | | | | | Rename process.h back to qtcprocess.h MSVC's "threads" standard header includes <process.h>, and that ends up including our process.h from Utils. There already was a hacky workaround in place for a similar issue with MINGW, but that doesn't work with MSVC because that doesn't have Simply use a name that doesn't conflict. Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* QmlJsPluginDumper: Ensure we don't take results from the canceled futuresJarek Kobus2024-02-231-0/+6
| | | | | | | | | Amends 91c1c244a1256b2dc9979edb1a3ce83c28ef5636 Fixes: QTCREATORBUG-30424 Change-Id: Ie0bddb79362945a040c6cb95edf37fbec3ed064d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlJSPluginDumper: Prevent potential crash when no results in QFutureJarek Kobus2024-02-151-0/+4
| | | | | | | Ensure we don't reference non-existing QFuture's result. Change-Id: I57668390e6ca83ae30c0b1de3e3a083a344ddbaa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make some more capturelists friendlier for C++20hjk2024-01-171-6/+9
| | | | | Change-Id: Ic00f75e1f59f5eb0430d24e4448a3bb7f8bfbd8d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Various Plugins: Simplify return FilePath statementsJarek Kobus2023-08-021-2/+2
| | | | | | | Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-041-4/+4
| | | | | | | | Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-031-1/+1
| | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <hjk@qt.io>
* RunExtensions: Move onResultReady and onFinished into asynctask.hJarek Kobus2023-04-171-1/+0
| | | | | | | Change-Id: I96dbf5b0253251224ae678172cd5fca12b34326a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QmlJS: Use QtConcurrent invocation for async runJarek Kobus2023-03-141-12/+10
| | | | | | | | | | Add ModelManagerInterface::importScan() overload to avoid instantiating dummy QPromise arg on caller side. Change-Id: Idf836d30b2167d8840cc4e7ac6f95377c9d5622a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlJS: Tr::TrAlessandro Portale2023-02-011-24/+25
| | | | | | | | Excluding the Qml parser, which needs to remain in sync with it's copy in Qt. Change-Id: I22f475f265dd74687e3239c4d6916c777798a447 Reviewed-by: hjk <hjk@qt.io>
* QmlJS: Proliferate FilePath usehjk2023-01-241-34/+23
| | | | | Change-Id: Ifd009ef9c6e15506d173727e84dda966d79bdb01 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*hjk2023-01-101-2/+2
| | | | | | | | | | | | ... and re-use the old QtcProcess::readAllStandard* names for a QString-returning 'decoded' version. For now, only use that in 'full Utf8' cases, to stay bug-compatible, the plan is, however, to employ the QTextCodecs we have already in the channel buffers. That will be one-by-one, though. Change-Id: Id209e0671920d4ea4197918e872f441254112d52 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* qmljs: Remove foreach usageArtem Sokolovskii2022-12-211-5/+6
| | | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Ifdb8cf514dfe328e0a64bde1beff3e63a4b7fbc3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | 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: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-08-261-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/qmljs/qmljsmodelmanagerinterface.cpp src/plugins/clangcodemodel/clangdclient.cpp src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp src/plugins/qmldesigner/designercore/include/modelnode.h src/plugins/qmldesigner/designercore/model/modelnode.cpp src/plugins/qmldesigner/designercore/model/rewriterview.cpp Change-Id: I93c57879b79f27325321bfc045ca618bd835af93
| * qmljs: reduce used threadsTim Jenssen2022-08-231-2/+3
| | | | | | | | | | | | Change-Id: I8f27037d0cfefd65f1ac060e1505328ea705a670 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | FileUtils: Adds toFilePathList functionMarcus Tillmanns2022-08-041-2/+3
| | | | | | | | | | | | Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-131-16/+24
|/ | | | | | | | | convert more QString containing paths to Utils::FilePath Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* PluginDumper: Connect to done() signalJarek Kobus2022-06-211-22/+11
| | | | | | | Instead of connecting to errorOccurred() and finished() signals. Change-Id: Iaf5fb4ec46919e37b0ab12ec4cbff904ae192de7 Reviewed-by: hjk <hjk@qt.io>
* Rename 'output pane' to simply 'output'Thomas Hartmann2022-03-011-1/+1
| | | | | | | Change-Id: If45e053a32855bca68dc71cb5da22f981146e45b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlJS: Proliferate FilePath use, part 3hjk2021-10-291-36/+30
| | | | | Change-Id: I3c293a9974414b669a1af8b98afb76a4eb4fbd11 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: Proliferate FilePath use, part 2hjk2021-10-281-31/+28
| | | | | Change-Id: I631df6ba5e782e2db9e03de4e5df843d15c19f37 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: Proliferate FilePath and QtcProcess use in QmlJSPluginDumperhjk2021-10-271-33/+30
| | | | | Change-Id: Ie483bb2e9b5d812d380470949564a6bc57801fa9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* qmljs: update Qml parser to parser of Qt 6.2Fawzi Mohamed2021-07-201-2/+2
| | | | | | | | | this is needed (among other things) for * null coalescing * shebang support Change-Id: I1b37fd86593f143de8b39c0daf433831a8785568 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Refactor tst_joinAllThreads, to be used in ModelManager d'torJarek Kobus2021-06-211-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea in this approach is that we only collect those futures, which have resulted from runAsync. The assumption is that all tasks associated with those futures may sooner or later finish, without the need to call qApp->processEvents(). OTOH, we don't collect fake futures coming from Utils::onFinished, as these requires the spinning event loop in order to deliver the onFinished signal. So, the new joinAllThreads() method waits for all collected futures to finish. We also _do_ want canceled and not finished futures to finish, since even when they are canceled, they may still be running and using the internals of possibly destructed ModelManager. This means, we are only waiting for other threads to be finished, without reporting their results to e.g. onFinished() handlers. Some tests require that all onFinished handlers are also processed. In order to achieve this, we create a loop inside tst_joinAllThreads() method and we call joinAllThreads(), so it will wait for all pending queue to finish, and then we call process events, in order to let finished futures propagate their results to their respective onFinished() handlers. Some handlers may have stared another threads when being processed, so we may expect that some new futures will appear. So, after processing the events we check if any new events appeared, and in this case we repeat the loop. Otherwise, we finish synchronization. Amends: 96c860159b862460e21be16a6e2839c0b591e016 Task-number: QTCREATORBUG-25350 Change-Id: I5e44150c55f6be00445a5695938482d948990c94 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Utils: filepathify fileutilsDavid Schulz2021-05-181-1/+1
| | | | | Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJS: Fix handling multiple import paths into same moduleChristian Stenger2021-01-211-6/+7
| | | | | | | | | | | It is possible to import components of different paths to fill a module. Take further paths into account when looking up types. Fixes: QTCREATORBUG-24405 Change-Id: I8d6bf0a324ea9c0d1fe9d91b40857f91f00dd662 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* qmljs: avoid compiler warningsFawzi Mohamed2020-11-261-3/+3
| | | | | Change-Id: I6640d461abb010ff694dfd06e1fe039f69338cc4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* qmljs: Fix parsing and and loading of qmldir importsFawzi Mohamed2020-11-261-4/+5
| | | | | | | | | | | | Add most changes to the qmldir parser of Qt6. This is not a direct application of the changes because they rely on changes to QtBase that are Q6 only. Ignore load errors of optional dependencies. Fixes: QTCREATORBUG-24772 Change-Id: I0b85818b602c8c7c1712e52318b4ca3f15364cc5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Use typed syntax in calls to QMetaObject::invokeMethodJarek Kobus2020-11-161-8/+4
| | | | | | | | | We do it wherever possible. Some places can't be fixed since they still rely on dynamic introspection (mainly QQuickItem cases). Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJS: Add workaround for missing imports in Qt >=5.15.0Christian Kamm2020-05-211-0/+74
| | | | | | | | | | | | | | | | The QtQuick module plugins.qmltypes in Qt 5.15.0 do not contain QML types like QtObject. Instead, they are found in the QtQml module. Something similar applies to QtQml and QtQml.Models and QtQml.WorkerScript. As Qt 5.15 can't use the "import" command in the qmldir file, this code instead detects the 5.15 QtQuick and QtQml modules and adds the dependent imports manually, as a workaround. Change-Id: I982e349298eb7200372390dfc384fb43a762b253 Task-number: QTCREATORBUG-23986 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Track futures to allow testingChristian Kamm2020-05-211-3/+6
| | | | | | | | | Tests often want to wait for all async tasks to finish before progressing. Change-Id: I61738df730ca341b5c9d227569d961cd1991b296 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Philip Van Hoof <philip@codeminded.be>
* QmlJS: Fix bug with async typeinfo loadingChristian Kamm2020-05-181-1/+1
| | | | | | | | | There were infinite loading loops, because the unupdated LibraryInfo was written to the ModelManager. Change-Id: I22faf017a2c9370e97042152cddc872a3d35fb77 Reviewed-by: Christian Kamm <mail@ckamm.de> Reviewed-by: Philip Van Hoof <philip@codeminded.be>
* qmljs: Use Utils::onFinished instead of manual QFutureWatcherPhilip Van Hoof2020-04-271-66/+78
| | | | | | | Change-Id: Iad6b958cb87ea5d4edaa270c27fac5ffdc334bba Fixes: QTCREATORBUG-20243 Task-number: QTCREATORBUG-18533 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmljs: Make the QMLJsPluginDumper asynchronous to avoid eventloop hangsPhilip Van Hoof2020-04-271-96/+164
| | | | | | | | Change-Id: I3f6e6acaaf3781d86a0fa5fb100219f92b70f0b5 Fixes: QTCREATORBUG-20243 Task-number: QTCREATORBUG-18533 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* qmljs: Do not use app.qmltypes and lib.qmltypes anymoreMaximilian Goldstein2020-03-271-14/+11
| | | | | | | Task-number: QTBUG-82710 Change-Id: I876ec2b8e2b668a239248511b0fbd58389098de6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJS: Scan app.qmltypes and lib.qmltypes for type informationUlf Hermann2019-10-311-8/+16
| | | | | | | | | | | | | | app.qmltypes is being added as a new convention to Qt 5.15. These files are to be found next to application binaries, and contain the QML types those application register themselves, in contrast to QML types registered from plugins loaded via the regular import mechanism. lib.qmltypes works the same way, in principle, for libraries. This change only adds it to the possible names for qmltypes files, though. Change-Id: I1d7c5835c8c3e988d214c5cdb949ca677b48dfc5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-2/+2
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Utils: Add toSet/toList functionshjk2019-07-021-3/+3
| | | | | | | | | As replacement for functionality that's being deprecated in Qt but still useful or needed, or that cannot easily be handled without resorting to #if QT_VERSION checks in user code. Change-Id: Id3575a54ff944bf0e89d452d13944fcaee270208 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix some deprecation warnings in basic pluginsFriedemann Kleint2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix warnings apppearing in 5.13, for example: warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations] ... warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations] warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations] warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations] ... warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] ... warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] ... warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations] ... warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations] warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations] warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations] ... warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations] Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJS: remove qtquick1 leftoversTim Jenssen2019-01-181-29/+8
| | | | | | | | QT_INSTALL_IMPORTS and the used ProjectInfo.qtImportsPath variable were only used for QtQuick1. Change-Id: I34da0cfc77effa84f3a7578e7f91fed0768a9bf4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* qmljs: remove remaining references to QtQuick1Marco Benelli2018-04-031-7/+0
| | | | | | | | This patch removes all references to QtQuick1 in qml library, plugin, designer, profiler and tests. Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJs: fix bug in resolving qml importsMarco Benelli2017-10-161-26/+14
| | | | | | | | | | | | The introduction of Controls.2 changed the way in which imports are resolved. This patch fix some leftovers of the old resolution scheme. Such leftovers caused false positives in import declaration to happen when resetting the QML/JS code model. The code has also been simplified a little, by the removal of duplicate code and of unused methods. Change-Id: I90bdf7ed47fdfea7cbd8259acd7a9a968f27301b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Remove spaces in initializer listsTim Jenssen2017-02-221-2/+2
| | | | | | | Format initializer lists code style like. Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.1'Eike Ziller2016-10-051-1/+5
|\ | | | | | | | | | | | | Conflicts: src/plugins/autotest/qtest/qttestoutputreader.cpp Change-Id: I4b323f2f3041d015fa04b9a25ec925f3b3e2411f
| * QmlJs: qmlplugindump working directoryMarco Benelli2016-09-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the plugin's parent path as working directory for the qmlplugindump process. This should be more reliable with regards to paths that include symbolic links to shared or remote volumes. Using the plugin's parent path will also be needed in order to handle relative paths passed to the dumper (ie: with the -dependencies option). This feature is not yet implemented in QtCreator. Change-Id: I9c863a95d03fc7d03c84e704e39f2e0520aaa01e Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | QmlJS: Replace macro usage with HostOsInfoOrgad Shaneh2016-09-121-30/+23
| | | | | | | | | | Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426 Reviewed-by: Marco Benelli <marco.benelli@qt.io>