Commit Graph

120 Commits

Author SHA1 Message Date
Ulf Hermann cc761e9c5a qmlprofiler: Fix data sorting
When analyzing a range with multiple child ranges, qmlprofiler would
create a rather random association between the start and end events.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I564d2c74656dda1cb0963c75cd7b947a7f86d05e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-25 18:35:05 +01:00
Yuhang Zhao 781714aefb Remove Qt keywords from all headers
It's good practice to do so.

Change-Id: I72435ff99aaee942c1d3b488ec5dedd7e82d1047
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-12-09 11:55:10 +08:00
Marc Mutz c2d490a238 Port from qAsConst() to std::as_const()
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: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-07 23:38:56 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
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: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Sona Kurazyan cd9939d50b Prepare for moving qVersion() from qglobal.h to qlibraryinfo.h
Include qlibraryinfo.h where it's used.

Change-Id: Ie2ea09458380e012f594e765b50a311a20b423d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-30 18:53:01 +02:00
Alexandru Croitor eed7b3f4e7 CMake: Don't use PUBLIC_LIBRARIES for executables
Change-Id: I346ea4eac1dfbfb7fb81609307f5f7c4716bb8d1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-21 13:19:04 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
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: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
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.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Allan Sandfeld Jensen 72c3befaa2 Replace 0 pointer constants with nullptr
Replaced in most common patterns.

Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-18 12:39:28 +02:00
Joerg Bornemann 0d6d3c7bc5 Skip unnecessary commands when cross-building tools
Call qt_internal_return_unless_building_tools() directly after
qt_internal_add_tool() to avoid having to special-case code for when
this function only creates imported targets in cross-builds.

Task-number: QTBUG-85084
Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-08 10:37:35 +02:00
Craig Scott 63a601dc29 CMake: Remove unneeded *.pro and .prev_CMakeLists.txt files
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.

Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-19 10:46:06 +10:00
Ulf Hermann 6e5eee54f9 QML profiler: Fix nonsensical condition
Failure to connect within 5s is a warning now, and not affected by the
verbosity setting.

Change-Id: Ia0bace7bfbb1c7aa09642b7036344d0929f9b2b8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-19 00:15:12 +01:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Alexandru Croitor 0f19f571ee CMake: Regenerate projects
We need the qt_add_tool changes to successfully configure qemu builds.
The rest of the changes are just to be in sync with the .pro files.

Change-Id: I7bcc08ac58f57a5761aedef09761428c55235289
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 15:51:40 +02:00
Karsten Heimrich 1b10ce6a08 Port QtDeclarative from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-16 22:46:16 +02:00
Alexandru Croitor 476d1f5760 CMake: Regenerate qtdeclarative/tools
Includes
 - A bunch of TARGET_DESCRIPTION

Change-Id: I6acfe05187afbdd45cf7e1bf8634f1554a51c791
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:19 +02:00
Alexandru Croitor 14492ecee2 CMake: Regenerate and adapt to merge from dev
Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-03-12 14:05:23 +00:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Edward Welbourne 744246b112 Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step cloaser to that goal.

Change-Id: I3214ad6ccaca9dfd4a026589cabeb40cbf4a6298
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-02 15:58:47 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor e9cac99f37 Regenerate projects
Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:26 +00:00
Alexandru Croitor c2f8b9535d Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.

Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
2019-10-14 19:02:37 +02:00
Simon Hausmann da4069a96b Fix interactive mode of qmlprofiler
Use the correct commands for toggling the recording status and flushing.
Also don't clear the event types when clearing the profiler data after a
flush, as those remain valid and are needed for processing in the
future.

Change-Id: I5a3cd5aa33e43a3e81c53cbbaa0c5b8fb407c5bb
Fixes: QTBUG-78044
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-09 10:13:10 +02:00
Alexandru Croitor 5a3e668533 Port the declarative tools
Also fix up QmlDevTools module to not depend on QtQml,
but instead make it include the headers / cpp files as it is done
in the qmake project.

Change-Id: I240c52d5357db150a7c0c819892fb0a3708ceee4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-08 08:22:42 +00:00
Friedemann Kleint 56d627832d Tools: Fix deprecation warnings about QProcess::finished(int)
Use QProcess::finished(int, QProcess::ExitStatus) with QOverload,
fixing:
qmlpreviewapplication.cpp:151:86: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
     connect(m_process.data(), static_cast<void(QProcess::*)(int)>(&QProcess::finished),
qmlprofilerapplication.cpp:475:83: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
    connect(m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished),

Change-Id: I0eb09e398b2a3b307fdd67a3fe505b1bdd1078f8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-05 11:48:42 +00:00
Ulf Hermann 8fc9828a36 qmlprofiler: Use std::cerr directly rather than through QTextStream
The application output already is in the right text encoding. There is
no point in re-encoding it. The re-encoding is actually expensive enough
to delay the target application in some cases, and that distorts the
profiling results.

Change-Id: I3a6c47801cba072f6cfff8d0d2c3d10725750d00
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-17 07:24:44 +00:00
Ulf Hermann 3a54b30784 Tools: Improve wording
We start an executable and that results in a process. "program" is not
very well defined here.

Change-Id: Iec00ec806843c93951f0dcfbfe46984bf599470f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-11-22 08:12:15 +00:00
Liang Qi 1169242f14 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/imports/imports.pro
	src/src.pro

Change-Id: Icdc39b6169d15b2102acd0e4d550a8d91e4b0744
2018-04-26 13:08:13 +02:00
Ulf Hermann 03739f2150 Make QtQmlDebug independent of QtQml
This means QtQmlDebug needs its own qqmlprofilerdefintions.h. This is a
good thing because this way we notice if we change the definitions in an
incompatible way. The test uses QtQmlDebug after all. Also,
qqmldebugserviceinterfaces_p.h is not available anymore, which means the
service names have to be spelled out. This, also, is beneficial as it
prevents us from accidentally changing the names.

In the context of QmlDebug we don't need to namespace the profiler
definitions, either. This simplifies some code.

Task-number: QTBUG-60996
Change-Id: Ibb39e48c9b758687d68b8ce4431f45eb26939a09
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-24 08:44:41 +00:00
Ulf Hermann 895a511245 QQmlDebugClient: Make stateChanged a signal
This way we can observe it from the outside and drop all the code that
genrated extra signals from the virtual method.

Also drop the unused QQmlDebugTestService::stateHasChanged signal to
reduce the confusion.

Change-Id: Ia37c1eaf8b392e594b0931694f43f84fe09b000c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-20 16:46:04 +00:00
Liang Qi bb7a5d0cb6 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4internalclass.cpp
	src/qml/parser/qqmljslexer.cpp
	src/qml/qml/v8/qv8engine.cpp
	src/qml/util/qqmladaptormodel_p.h
	src/quick/items/qquickanimatedsprite.cpp
	tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp

Change-Id: I16702b7a0da29c2a332afee47728d6a6ebf4fb3f
2018-02-27 08:43:10 +01:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Qt Forward Merge Bot cf142cd637 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I2d4c012c8ca578f90d7eb56dbc6b306ac7cbb841
2018-02-15 21:05:45 +01:00
Liang Qi 4d525de33e Merge remote-tracking branch 'origin/5.10' into 5.11
Conflicts:
	src/imports/shapes/qquickshape.cpp
	src/imports/shapes/qquickshape_p_p.h
	src/qml/compiler/qqmlpropertycachecreator_p.h
	src/qml/jsruntime/qv4value_p.h
	src/quick/items/qquickloader_p.h
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
	tools/qmlprofiler/qmlprofilerapplication.cpp

Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
2018-02-12 16:31:13 +01:00
Ulf Hermann aa9027a1d8 qmlprofiler tool: Fix message in interactive mode
The "Really Quit?" can be posted for more than one reason. Only repeat
the last part if the user doesn't press 'y' or 'n'. Also, output an
extra newline on exit, so that the shell prompt shows up again.

Change-Id: Ide0372e1e11059d6b8089750f5e665f05aa60122
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-07 16:32:21 +00:00
Liang Qi 6fe4c1f280 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp

Change-Id: I64f7c1d776fab3cad4530f291b93afd2a8fb8533
2018-02-05 10:25:15 +01:00
Ulf Hermann fb84bcb487 qmlprofiler tool: In attach mode, finish when connection drops
We won't have a process that terminates in this case and we don't want
to wait forever.

Task-number: QTBUG-66159
Change-Id: I5d0bbe2f8bc9c7cbc8732272ccca779d5f9bcc7d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-02 15:01:38 +00:00
Ulf Hermann b82296f825 Use better QmlProfiler client from Qt Creator
This client can track locations itself, and thus doesn't require the
server to send the event types over and over with each message. Once all
our client implementations have this feature we can drop a lot of code.

Furthermore, this way we can write regression tests for bugs that only
occur when client side location tracking is active.

Change-Id: I3735392452e20a7be98e92b900fadef04701d85f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-02 09:38:46 +00:00
Kai Koehne fc3f8766d5 Adjust QMAKE_TARGET_PRODUCT, QMAKE_TARGET_DESCRIPTION
The product should be Qt5 (the default). The QMAKE_TARGET_DESCRIPTION is
actually less than a description but a beautified name, that is shown
e.g. in the task manager, crash reporting tool etc. Make it title case,
like most Windows applications do.

Change-Id: I570aee2c2016e78fdb7a93c2d7a66b70fdcb0cff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-28 10:57:06 +00:00
Kai Koehne 11a664a752 Remove custom setting of qmake VERSION field in tools
qt_tool.prf sets the VERSION to MODULE_VERSION by default. Also,
qmake automatically makes it a quadruple for the .rc file metadata.

Change-Id: Ie2d0f2022c4416ce824a6786eef4a8c461ed70f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-28 10:41:43 +00:00
Lars Knoll c3e1e6390e Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
2017-05-02 08:40:48 +02:00
Thiago Macieira 80dc036882 Run includemocs in qtdeclarative
Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-26 13:19:13 +00:00
Samuel Gaist 70a5d7bd87 Migrate to QRegularExpression
This patch updates the code base to use QRegularExpression in the place
of the deprecated QRegExp class.

Change-Id: I3231ac9f7902a1cd16cd4ef5f26e6cdc05e2fa4b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-04-09 22:17:20 +00:00
Samuel Gaist 4b445c487d QRegExp include cleanup
This patch adds missing include statement where the QRegExp class is
used.

Change-Id: I02d2995dd380f1e4db3777ae9759098c0e7757bd
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-03-17 08:00:17 +00:00
Liang Qi b1fa22c168 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/quick/accessible/qaccessiblequickview_p.h
	src/quick/items/qquickmousearea.cpp
	src/quick/util/qquickanimatorjob.cpp
	tools/qmlplugindump/main.cpp

Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
2017-02-24 11:48:14 +01:00
Friedemann Kleint dc0a7d7021 Tools: Add product name, version and description to the .pro files
This information will then be visible in Windows explorer.

Change-Id: I9d2f936584308394b4e3246d57bed44083b3cbca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-31 08:44:36 +00:00
Alexander Volkov 3dd96630a2 headers: Add missing override and remove redundant virtual
Change-Id: Ifa816ebcd79372afca42dbd0dc0ecde006bb688a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-07 20:10:22 +00:00
Anton Kudryavtsev 457bb7a465 tools: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.

Change-Id: If9018391c001eba3b4b2061d06c4caa8136811ab
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-22 16:44:33 +00:00