Commit Graph

91 Commits

Author SHA1 Message Date
Maximilian Goldstein
05d34a7e1a tracing/MainView: Fix broken MouseArea signal handler
onCancelled tries to trigger the signal pressed() which is shadowed
by the property of the same name. Properly handled this by moving
the onPressed handler into its own function.

Change-Id: I8ed966e256acdd8dc76d9ee5b244682217323a0d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-23 13:11:53 +00:00
Alessandro Portale
aef1954bcf Tracing: Fix flame graph combobox
By using another style.

Also icrease the combobox width from the implicit 120px to 260px,
because the new style needs more space, and would cut off text. When we
drop Qt 5 support, we can use implicitContentWidthPolicy for that.

Fixes: QTCREATORBUG-27041
Change-Id: I438f64083c10f192125e0414640ad0b7eef2970c
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2022-02-15 20:51:07 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Eike Ziller
ae0b648a85 CMake build: Allow compilation without QtQuick
Disable the parts that require it in that case.

Change-Id: I3f62eb9b325905ea225009aad6b9020cef545da6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-20 12:07:39 +00:00
Christian Kandeler
49569574de Fix some warnings about unused variables and functions
Change-Id: I5f0acd9598bc7f3a79963cc4e1b255e2b6fb2e5d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-27 08:47:36 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Laszlo Agocs
0caf69cc52 Migrate to fixed add_shaders prefix handling
One way to get rid of the "qml" in there is to use BASE.
An alternative would be to update the file paths in the source code.
Here we chose the former.

Change-Id: If49cb584aea022d5d74b2348ec99ed831b715111
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-10 11:03:53 +00:00
Eike Ziller
b09b6bd747 Merge remote-tracking branch 'origin/5.0'
Change-Id: I370268624bd6e91e7b44fa236e913f5f55867e17
2021-08-20 09:50:30 +02:00
Alessandro Portale
c568ab89c5 Tracing/QmlProfiler/PerfProfiler: Fix qt_add_qml_module call
This change fixes the failing configuration against a recent Qt (post
6.2-Beta2) build:

CMake Error at QTDIR/qtbase/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:196
(message):
  PLUGIN_TARGET must also be provided when NO_CREATE_PLUGIN_TARGET is
  used.
  If you want to disable creating a plugin altogether, use the NO_PLUGIN
  option instead.

Change-Id: If1dbfb09bda8e8cdd07cc575076dd6ccec1a4d39
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-20 07:03:24 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
Alessandro Portale
21cb0711c4 Tracing/QmlProfiler: Port shaders to Qt 6
For each shader in Tracing and QmlProfiler:
- Add a vert/frag variant in Vulkan style GLSL
- Include the shader via qt_add_shaders
- Implement RHI/Qt6-specific code for loading the shaders and for
  updating the uniform buffer
- Set the material's QSGMaterial::CustomCompileStep flag to affect the z
  value the same way as the Qt 5 code does

Building of Tracing, QmlProfiler, etc. with Qt 6 depends on the Qt
Shader tools being installed.

Fixes: QTCREATORBUG-20575
Change-Id: I9aba5a777da9a549da0cdd0a217dfcb346c72e58
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-08-11 08:05:22 +00:00
Alessandro Portale
84a0170516 Tracing/QmlProfiler: Prepare for porting of shaders to Qt 6
This change touches up the shader handling code in Tracing and
QmlProfiler in order to pave the way for the pending porting of
the shaders to Qt 6.

- Use QSGGeometry::Attribute::createWithAttributeType instead of
  QSGGeometry::Attribute::create
- Undefine some fields that are unused in Qt 6
- Add a couple of comments to document the relation between C++
  variables and shader attributes
- Extract some code into functions

Change-Id: I0e7119484b6190a415a5c2d2a0bbd6465088cf19
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-08-11 08:04:32 +00:00
Alessandro Portale
932d78c3e0 Tracing: Fix some more warnings regarding parameter injection
Parameter "XYZ" is not declared. Injection of parameters into signal
handlers is deprecated. Use JavaScript functions with formal parameters
instead.

Change-Id: I2d2b4f72b6c6bf532c090956a5286e3d38f867a3
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-07-27 04:57:34 +00:00
Alessandro Portale
5aff1419fa Tracing: Restore support for Qt >= 6.2
First (try to) add the "Tracing" target as Qt Creator library, *then*
check whether it exists.

amends: f29d7b896f

Change-Id: I931e3ff632324faf4c6e07e8e083f00c55df197f
Reviewed-by: hjk <hjk@qt.io>
2021-07-16 08:11:20 +00:00
Alessandro Portale
f29d7b896f Restore support for CMake < 3.11
Prior to CMake 3.11, the SOURCES could not be omitted when
calling add_executable.

This change ensures that SOURCES are passed, at least when
building against Qt < 6.2.

Change-Id: I83bd82fe12364523ce6954d145b632df7210d118
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-15 19:29:14 +00:00
Alessandro Portale
f787afe732 Tracing: Fix a couple of warnings regarding parameter injection
Parameter "XYZ" is not declared. Injection of parameters into signal
handlers is deprecated. Use JavaScript functions with formal parameters
instead.

Change-Id: I3aea1af6bb6559f26dc83b8c20ada11885b715f9
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-07-15 12:42:22 +00:00
Alessandro Portale
f43ac65ccb Don't call qt_add_qml_module with inexistent TARGET
If the passed TARGET does not exist (because it had been disabled in the
CMake configuration), qt_add_qml_module will create it for the user.
That created target is by itself incomplete and breaks the build.

So, don't call qt_add_qml_module with inexistent TARGET.

Fixes: QTCREATORBUG-25960
Change-Id: I646eb2176befb0fd5fe06e184ebd0cee32e18ab2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-02 15:35:24 +00:00
Alessandro Portale
3ebe5dbb99 Tracing: Use qt_add_qml_module for tst_flamegraphview
Use the CMake-based qml API to create the
"QtCreator.TstTracingFlameGraphView" module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: I7b1d7109c5fcff55c7be4b431f21281a63d13332
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-28 15:06:39 +00:00
Alessandro Portale
d720a7fb21 Tracing: Use Qt5_VERSION to check the Qt version in CMake
Instead of QT_VERSION.

Change-Id: I466f4daee623b91aadda5160cc7dec104788f66c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-25 07:38:45 +00:00
Alessandro Portale
a56ce4e450 Tracing: Add qml, register types via qt_add_qml_module
Use the CMake-based qml API to create the "QtCreator.Tracing" module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: I4d63f9f724d0628cfaab9d1164c0d575f15d15aa
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-22 11:58:05 +00:00
Alessandro Portale
43c5944571 Tracing/QmlProfiler/CtfVisualizer/PerfProfiler: Compile with Qt 6
This makes the tracing lib, its tests and the three plugins which depend
on the lib compile with Qt 6.

The rectangles are not yet shown most likely because some OpenGL
specific code was #ifdef-ed for Qt 6. That code needs to be
reimplemented on top of the new Scenegraph API, using the RHI instead of
direct OpenGL in a follow-up patch.
An assertion failure in QQuickWidget::createFramebufferObject() needs to
be fixed as-well.

The code still builds and runs assertion free (and the autotests pass)
when built against Qt 5.

Task-number: QTCREATORBUG-20575
Change-Id: I47ebb477823de2f0d27329dac7c292a466cea1d7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-09 15:30:21 +00:00
Alessandro Portale
b730aa6405 Tracing/QmlProfiler/Perfprofiler: Merge modules
Move Tracing Qml Types into the "QtCreator.Tracing" module.
Move QmlProfiler Qml Types into the "QtCreator.QmlProfiler" module.
Move PerfProfiler Qml Types into the "QtCreator.PerfProfiler" module.
And tst_flamegraphview ones into QtCreator.TstTracingFlameGraphView.

... in preparation to register the types declaratively.

Change-Id: Ic0e3863d09b3426fa5b7419116625ad49b817dcf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-08 06:46:28 +00:00
Alessandro Portale
9471be780a Tracing: Fix handling of expandedRowHeightChanged signal
I missed to add the parameters to the signature of the signal handler
function.

Amends 15e4ac3377

Change-Id: I5b260007643105e47f1336623cd7fcd767293bd3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-18 12:46:43 +00:00
Alessandro Portale
15e4ac3377 Tracing: Fix runtime QML warnings
"QML Connections: Implicitly defined onFoo properties in Connections are
deprecated. Use this syntax instead: function onFoo(<arguments>)"

Change-Id: Idf65152f5aa1b96a739bd41f87893270b9da8e1b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-28 20:54:36 +00:00
Alessandro Portale
93fbd5be02 Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.

Add a comment in porting.h where we still need such code for sdktool.

Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 19:12:39 +00:00
Eike Ziller
30da5aafd7 CMake build/Qt6: Automatically disable build of profilers
Tracing library does not build with Qt 6. Disable that automatically
and also the plugins that depend on it. Add some feature info for
the Tracing library, though we usually do not add feature information
for libraries in general.

Change-Id: I51b6993e30ec69d63a031c7bf404ea3887e14d84
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-05 12:29:57 +00:00
Christian Kandeler
7d4a632cb2 qbs build: Remove code for creating deployment packages
Not a use case anymore, and if it were, we'd do it using built-in
capabilities.

Change-Id: I4c588ad7fb282530880210cb4c5795677074b1e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 16:11:49 +00:00
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
hjk
e8e5f4e7be Some Qt6 compilation
Change-Id: If31ea0ec979969b034a1b0617e0c122b2968acd7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-04 07:12:42 +00:00
Christian Stenger
050f6b083c Qbs: Fix linking tests when building release with tests
Change-Id: I5df34f06b5ca107b5e85cf6319d6d08aba244e5b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-28 13:12:54 +00:00
hjk
21b11236d0 Tracing: Replace QLinkedList
Task-number: QTCREATORBUG-24098
Change-Id: I45e2f5c310b7094e02bd1a5d31caef6c164c4c57
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-18 11:19:29 +00:00
Alessandro Portale
24a25eed14 Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 20:56:57 +00:00
Cristian Adam
4a20a596c8 CMake Build: Use shared precompile headers
This will make the build directory size smaller, as only two
pch files will be generated. Not one for every target.

Change-Id: I3eec91e7536eab1c62bff8843f075f0ef7b5fff6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-09-19 11:38:34 +00:00
Sona Kurazyan
6f4aa0458c Remove usages of deprecated APIs (part 2)
Replace the uses of deprecated APIs listed below, while keeping in mind
that compatibility with Qt 5.12 (the latest LTS) must be kept. This
means that the new alternatives must be used only when compiling with
Qt versions where the replacement is available.

Replaced:
  QLineF::intersect() -> QLine::intersects() (since 5.14)
  QComboBox::activated() -> QComboBox::textActivated() (since 5.14)
  QWheelEvent::pos() -> QWheelEvent::position() (since 5.14)
  QList::swap() -> QList::swapItemsAt() (since 5.13)

Task-number: QTBUG-76491
Change-Id: I62adc4f0826607b0156bf4bc5648ffb0e41cd895
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-03 09:15:24 +00:00
Tim Henning
41361047b4 Tracing: Add hasMixedTypesInExpandedState property to TimelineModel
If the property is true, it disables the functionality to select the
type of row by clicking on the row label.
This is required by the CtfVisualizer plugin that shows more than one
type of events per row in the expanded state which would make the above
mentioned functionality meaningless.
This change doesn't change the current default behavior.

Change-Id: I20d42404a4cd3c9142bf0b59b57f4de083be07f3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-29 13:36:52 +00:00
Tim Henning
cdf4562eb8 Tracing: Add tooltip and category color properties to TimelineModel
This doesn't change the existing behavior. The new properties are used
by the upcoming CTF plugin.

Change-Id: Ic375e8d70fdc7dbd3c124f83087a0e220a76f2c1
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-14 07:14:51 +00:00
Tim Henning
78aee4e594 Tracing: Add space between duration and time unit
According to the SI convention, there is always a space between the
number and the unit.
I think we can leave it as is for the combination of multiple units for
the sake of compactness.

Change-Id: I11efc7ec4fc54a8adbf64e51817f2f8ad567bcea
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-14 07:14:39 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
Eike Ziller
3ab3e68a7b Merge remote-tracking branch 'origin/4.10'
Change-Id: I427280fdb207b878000697dfd37595ffdb26f4e7
2019-07-26 10:30:03 +02:00
Cristian Adam
8ae9cfe39d CMake build: Add "Devel" package
The "Devel" package will contain headers, libraries, documentation
needed by the 3rd parties to build Qt Creator plugins.

Fixes: QTCREATORBUG-22514
Change-Id: If54929f823982b921b98a63ff6085d53618a3a49
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-25 14:06:46 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Ulf Hermann
e9d36fe9ef Tracing: Use Combobox for the modes menu
This is a better fit than a custom Button + Menu combination.

Fixes: QTCREATORBUG-22579
Change-Id: Ie6f8a7ef2ce0da67a16bc365d6f619a11bc56221
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2019-07-05 12:31:44 +00:00
Ulf Hermann
bcc62b6f72 Tracing: port to QtQuickControls2
Controls1 is deprecated. Also, we can easily show tooltips for all
buttons this way.

Change-Id: I08c3e49139aa31f83e6c7585d8e33ee0140ce5b0
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2019-07-05 12:31:31 +00:00
Ulf Hermann
0db635ac58 Tracing: Restrict category tooltip to label text
We don't want the tooltip to show up on the disabled expand button.

Change-Id: I0ac6f185a6d6a5e01d07e1dcdacba736816f151e
Reviewed-by: Tim Henning <tim.henning@kdab.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 11:48:04 +00:00
Tim Henning
7f970cebb3 Tracing: Add tooltip to category labels in analyzer timelines
This is especially useful for longer names that often get elided in the
Perf Profiler and the new Chrome Trace Format Visualizer.

It uses a dummy button to show the same tooltip style as the buttons
while not having to import QtQuick.Controls.Private.

Change-Id: I5580a9ecc1acb69b0faec00a2f35952df0e1ce92
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-17 07:51:20 +00:00
Tim Henning
d25c7ea137 Tracing: Improve event adding performance by using at() instead of []
This speeds up adding events using Timeline::TimelineModel::insert()
by 20% in release mode and reduces it to a third in debug mode by
avoiding a check whether the container is detached.

Change-Id: I3c81120047c33b3ce20cfb4cd309cbe17694b141
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-05-28 09:06:57 +00:00
Orgad Shaneh
1e138fbe10 Remove excess blank lines after namespace
Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 06:50:16 +00:00
Cristian Adam
d855b84c5d Qt Creator CMake port
Based on Tobias Hunger's work from a few months ago.

The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.

Auto tests are run with "ctest". At the moment the pass rate is 87%.

Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 13:33:28 +00:00
Eike Ziller
75696f9639 Merge remote-tracking branch 'origin/4.9'
Change-Id: I95c56cc9371959f96afde3677fc82481f36f66c8
2019-04-12 14:31:01 +02:00
Ulf Hermann
3b30353e4b Tracing: Update selection range when timeline width changes
The viewTimePerPixel needs to be adapted then.

Change-Id: Ie057c780cc75099f1b9df18c79c5e133411ef8e6
Fixes: QTCREATORBUG-22094
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-10 12:17:05 +00:00