Commit Graph

58 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Anton Kudryavtsev 829c8faee2 tools: use QStringRef more
Change-Id: I4fccbfb2b965daf3a31846d1d51d39eb74ad944d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-12 12:09:35 +00:00
Ulf Hermann bd48f0e5ed Tooling: Convert connects to Qt5 style
Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 09:17:49 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Ulf Hermann fee44872dc Extend QDebugMessageService
Add category and timestamp, and allow synchronizing the timestamps with
QQmlProfilerService.

Change-Id: I8dc67e43e1087e231167fc4cfdfb5f659e00c5b2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-17 18:42:56 +00:00
Ulf Hermann 57430b2bda Move QML profiler client to qmldebug
Change-Id: I506909b68be6cbad631d1645673c2d38460aed33
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:53 +00:00
Ulf Hermann cdb0ddeffd QmlProfiler: Collect useful input events
Just "Key" or "Mouse" as only attributes of input events are not very
useful. This change adds some additional information and also collects
input events from QQuickWindow.

Change-Id: I062bbffeef3fa87776bc8be33f2321edf793faa2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:45 +00:00
Ulf Hermann b5cd093559 qmlprofiler: Use local socket connection by default
This is faster and more reliable.

Change-Id: I2eef4c7ffa99daf68d0f7a53a959f4fc788666c5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 20:07:40 +00:00
Ulf Hermann 79ed2f70f0 Move QQmlDebugClient into separate static library
Change-Id: Ib3daf9da2cf6798bd022cfcf54d11e565c9cb4ca
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-30 19:05:07 +00:00
Ulf Hermann 35fa7aed1d qmlprofiler: Clear trace client when trace is finished
If the application was killed with -9 or similar there may be some
open ranges left. We don't want them to influence the next session.

Change-Id: I284086ff96d81a829f02e160ef8b82417fd51466
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:23:43 +00:00
Ulf Hermann d56286283d qmlprofiler: Simplify QmlProfilerClient
We only need one class for it now.

Change-Id: Iea2715993c0ce168a3ceeecbb694f1ad3585da68
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:23:29 +00:00
Liang Qi 7063fefe4b Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
2015-10-14 15:48:12 +02:00
Friedemann Kleint 16154fba86 Tools: Fix single-character string literals.
Use character literals where applicable.

Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-13 13:40:44 +00:00
Ulf Hermann 9713146cbc qmlprofiler: Remove V8 profiler client
It's been a long time since the last Qt version with V8.

Change-Id: Iae36dd1c5bb6275254c6a64a8e6b843454139e2b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-28 08:59:30 +00:00
Ulf Hermann fbdc01f141 Allow specification of loadable debug services via command line
We don't want to load the debugger when profiling and vice versa. This
makes it easier to prevent unwanted services from getting loaded.

Task-number: QTBUG-47623
Change-Id: I28893b6218110274a6d30b27805d89dbb443add3
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-08-13 08:30:47 +00:00
Ulf Hermann 30ead66c62 qmlprofiler: Use QQmlProfilerDefinitions for accessing definitions
Change-Id: I6def7dd8a0ce0db22ad4829029d8510f5869c813
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-23 08:26:04 +00:00
Ulf Hermann 58a5aa3a09 qmlprofiler: Remove some dead code
Change-Id: If1f542bc73d5af259ea3c0a5da40786f8d6f3dbf
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-15 09:31:13 +00:00
Ulf Hermann db69cd87d3 qmlprofiler: Allow specification of features to record
Task-number: QTBUG-43066
Change-Id: I963a5a483f961dd150f00de3d96c723c8b62edb8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-09 18:31:55 +00:00
Ulf Hermann 08533d2659 qmlprofiler: Record input events
Change-Id: Ib6413d97638b192377d7dbeb19ed0c2f733a06a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-09 18:31:47 +00:00
Ulf Hermann 6247e30afb qmlprofiler: Output data after application quits in non-interactive mode
Change-Id: I38abed0d5af3bcc7be5fa9e21bde14be40a3ce1d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-07 08:26:19 +00:00
Ulf Hermann aa68eab142 qmlprofiler: Redirect app stdout to qmlprofiler stderr
This seems to be a common technique for tools that wrap application
execution and potentially have their own output.

Change-Id: I4ca1bc5861d5b915b4ca07aec08ad06c8c73c8d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-07 05:48:46 +00:00
Ulf Hermann cd0b001ec8 qmlprofiler: Improve options for trace output
* Remove the auto-generation of file names.
* Accept file names as parameters or from interactive commands
* Output to stdout by default for better scripting and quick preview
* Decouple output from clearing of data so that you can write the same
  data multiple times.

Task-number: QTBUG-43066
Change-Id: Ia4cc3701cbac7c6f8948b11307130a5d6a2ff44c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-06 21:13:25 +00:00
Ulf Hermann c402f59359 qmlprofiler: Only accept commands if we ask for them
This way we can shut down the input thread after the last command and we
cannot get commands before we can process them.

Change-Id: Ie1583a338da9c9df0e07c9e09ce185857c5ea66d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-06 15:20:33 +00:00
Ulf Hermann 583543ebda qmlprofiler: In interactive mode, don't quit if application quits
We might want to inspect or save the pending data in some special way.

Change-Id: I235b1f948ad4a9ddd100332991243231119bcf08
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-21 15:19:38 +00:00
Ulf Hermann 864b1c498c qmlprofiler: Add non-interactive mode and make it the default.
If you just run a test application through the profiler without any
further parameters, you want it to record the data the application
generates and then terminate itself.

[ChangeLog][QtQml][Behavior Change] Make qmlprofiler command line
interface better suited for scripting.

Task-number: QTBUG-43066
Change-Id: I831e714b9c7b4b984b6450ad5c78ba4fdae6b8f6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-21 12:54:48 +00:00
Ulf Hermann 455e9153eb qmlprofiler: Clean up recording state mess
The recording state is a global property of the profiler client, it has
to match the application's recording status as well as possible, and
the user can set an initial target value with a command line parameter.

This way we don't get strange error messages when the application quits
by itself and properly sends all the data before.

Task-number: QTBUG-43066
Change-Id: Id93aa7fb940f870c8f16cea8427c38aab450f864
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-21 12:54:42 +00:00
Ulf Hermann bb085ff927 qmlprofiler: Add some sanity to command line parsing.
Use QCommandLineParser to allow for double-dash options and improve the
help text.

Task-number: QTBUG-43066
Change-Id: Iac772cbbf750016a9058658c9b4b275faf8fb62f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-21 12:54:40 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Ulf Hermann 74f483f231 Write memory events into tracefiles generated by qmlprofiler
Change-Id: Ic01505194f29967ed1aad16fe36e14dc5532ae25
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-12 10:16:40 +02:00
Ulf Hermann 2371ec96da Properly support all events in trace files and clean up a bit.
In particular, use both message and range type to identify events so
that we can get rid of the messy type aliasing.

Task-number: QTBUG-36953
Change-Id: I691a7501aa285f78f7ce5b7017ef50628f44fcf7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-06-06 09:51:33 +02:00