forked from qt-creator/qt-creator
Tracing/QmlProfiler/PerfProfiler/CtfVisualizer: Remove pre Qt 6.2 code
- Remove code for Qt below 6.2 from c++ sources and CMakeLists.txt - Remove Qml code from .qrc files - Qbs: Add qt.core.resource_data Groups for Qml code - Remove OpenGL shader .frag and .vert files - Remove Qml import version numbers Change-Id: I3bd1cd95381e66c98ee3af4259e89b0b1eff0709 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -32,94 +32,82 @@ set(TRACING_CPP_SOURCES
|
|||||||
tracing_global.h
|
tracing_global.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
find_package(Qt6 COMPONENTS ShaderTools QUIET)
|
||||||
add_qtc_library(Tracing
|
|
||||||
FEATURE_INFO
|
|
||||||
DEPENDS Utils Qt5::Qml Qt5::Quick
|
|
||||||
PUBLIC_DEPENDS Qt5::Widgets
|
|
||||||
SOURCES
|
|
||||||
${TEST_SOURCES}
|
|
||||||
${TRACING_CPP_SOURCES}
|
|
||||||
qml/tracing.qrc
|
|
||||||
)
|
|
||||||
else() # < Qt 6.2
|
|
||||||
find_package(Qt6 COMPONENTS ShaderTools QUIET)
|
|
||||||
|
|
||||||
add_qtc_library(Tracing
|
add_qtc_library(Tracing
|
||||||
CONDITION TARGET Qt6::ShaderTools AND TARGET Qt5::Quick
|
CONDITION TARGET Qt6::ShaderTools AND TARGET Qt5::Quick
|
||||||
FEATURE_INFO
|
FEATURE_INFO
|
||||||
DEPENDS Utils Qt5::Qml Qt5::Quick
|
DEPENDS Utils Qt5::Qml Qt5::Quick
|
||||||
PUBLIC_DEPENDS Qt5::Widgets
|
PUBLIC_DEPENDS Qt5::Widgets
|
||||||
SOURCES
|
SOURCES
|
||||||
${TEST_SOURCES}
|
${TEST_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT TARGET Tracing)
|
if (NOT TARGET Tracing)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(TRACING_QML_FILES
|
set(TRACING_QML_FILES
|
||||||
qml/ButtonsBar.qml
|
qml/ButtonsBar.qml
|
||||||
qml/CategoryLabel.qml
|
qml/CategoryLabel.qml
|
||||||
qml/Detail.qml
|
qml/Detail.qml
|
||||||
qml/FlameGraphDelegate.qml
|
qml/FlameGraphDelegate.qml
|
||||||
qml/FlameGraphView.qml
|
qml/FlameGraphView.qml
|
||||||
qml/ImageToolButton.qml
|
qml/ImageToolButton.qml
|
||||||
qml/MainView.qml
|
qml/MainView.qml
|
||||||
qml/Overview.qml
|
qml/Overview.qml
|
||||||
qml/RangeDetails.qml
|
qml/RangeDetails.qml
|
||||||
qml/RangeMover.qml
|
qml/RangeMover.qml
|
||||||
qml/RowLabel.qml
|
qml/RowLabel.qml
|
||||||
qml/SelectionRange.qml
|
qml/SelectionRange.qml
|
||||||
qml/SelectionRangeDetails.qml
|
qml/SelectionRangeDetails.qml
|
||||||
qml/TimeDisplay.qml
|
qml/TimeDisplay.qml
|
||||||
qml/TimelineContent.qml
|
qml/TimelineContent.qml
|
||||||
qml/TimelineLabels.qml
|
qml/TimelineLabels.qml
|
||||||
qml/TimelineRulers.qml
|
qml/TimelineRulers.qml
|
||||||
qml/TimelineText.qml
|
qml/TimelineText.qml
|
||||||
qml/TimeMarks.qml
|
qml/TimeMarks.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
set(TRACING_QML_RESOURCES
|
set(TRACING_QML_RESOURCES
|
||||||
qml/ico_edit.png
|
qml/ico_edit.png
|
||||||
qml/ico_edit@2x.png
|
qml/ico_edit@2x.png
|
||||||
qml/ico_rangeselected.png
|
qml/ico_rangeselected.png
|
||||||
qml/ico_rangeselected@2x.png
|
qml/ico_rangeselected@2x.png
|
||||||
qml/ico_rangeselection.png
|
qml/ico_rangeselection.png
|
||||||
qml/ico_rangeselection@2x.png
|
qml/ico_rangeselection@2x.png
|
||||||
qml/ico_selectionmode.png
|
qml/ico_selectionmode.png
|
||||||
qml/ico_selectionmode@2x.png
|
qml/ico_selectionmode@2x.png
|
||||||
qml/range_handle.png
|
qml/range_handle.png
|
||||||
qml/range_handle@2.png
|
qml/range_handle@2.png
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(file IN LISTS TRACING_QML_FILES TRACING_QML_RESOURCES)
|
foreach(file IN LISTS TRACING_QML_FILES TRACING_QML_RESOURCES)
|
||||||
get_filename_component(fileName "${file}" NAME)
|
get_filename_component(fileName "${file}" NAME)
|
||||||
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
|
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
qt_add_shaders(Tracing "res_tracingshaders"
|
qt_add_shaders(Tracing "res_tracingshaders"
|
||||||
BATCHABLE
|
BATCHABLE
|
||||||
PREFIX
|
PREFIX
|
||||||
"/QtCreator/Tracing"
|
"/QtCreator/Tracing"
|
||||||
BASE
|
BASE
|
||||||
"qml"
|
"qml"
|
||||||
FILES
|
FILES
|
||||||
qml/notes_qt6.vert
|
qml/notes_qt6.vert
|
||||||
qml/notes_qt6.frag
|
qml/notes_qt6.frag
|
||||||
qml/timelineitems_qt6.vert
|
qml/timelineitems_qt6.vert
|
||||||
qml/timelineitems_qt6.frag
|
qml/timelineitems_qt6.frag
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_add_qml_module(Tracing
|
qt_add_qml_module(Tracing
|
||||||
URI "QtCreator.Tracing"
|
URI "QtCreator.Tracing"
|
||||||
VERSION "1.0"
|
VERSION "1.0"
|
||||||
NO_PLUGIN
|
NO_PLUGIN
|
||||||
QML_FILES
|
QML_FILES
|
||||||
${TRACING_QML_FILES}
|
${TRACING_QML_FILES}
|
||||||
RESOURCES
|
RESOURCES
|
||||||
${TRACING_QML_RESOURCES}
|
${TRACING_QML_RESOURCES}
|
||||||
SOURCES
|
SOURCES
|
||||||
${TRACING_CPP_SOURCES}
|
${TRACING_CPP_SOURCES}
|
||||||
)
|
)
|
||||||
endif() # < Qt 6.2
|
|
||||||
|
@@ -49,9 +49,7 @@ class TRACING_EXPORT FlameGraph : public QQuickItem
|
|||||||
Q_PROPERTY(bool zoomed READ isZoomed NOTIFY rootChanged)
|
Q_PROPERTY(bool zoomed READ isZoomed NOTIFY rootChanged)
|
||||||
Q_PROPERTY(int selectedTypeId READ selectedTypeId WRITE setSelectedTypeId
|
Q_PROPERTY(int selectedTypeId READ selectedTypeId WRITE setSelectedTypeId
|
||||||
NOTIFY selectedTypeIdChanged)
|
NOTIFY selectedTypeIdChanged)
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FlameGraph(QQuickItem *parent = nullptr);
|
FlameGraph(QQuickItem *parent = nullptr);
|
||||||
|
@@ -23,11 +23,11 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
ToolBar {
|
ToolBar {
|
||||||
id: buttons
|
id: buttons
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: labelContainer
|
id: labelContainer
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
|
|
||||||
TimelineText {
|
TimelineText {
|
||||||
property bool isLabel: false
|
property bool isLabel: false
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: flamegraphItem
|
id: flamegraphItem
|
||||||
|
@@ -23,12 +23,12 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
import QtQml 2.2
|
import QtQml
|
||||||
import QtQuick 2.9
|
import QtQuick
|
||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls
|
||||||
import QtQuick.Controls.Material 2.3
|
import QtQuick.Controls.Material
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
id: root
|
id: root
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
ToolButton {
|
ToolButton {
|
||||||
implicitWidth: 30
|
implicitWidth: 30
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: overview
|
id: overview
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.9
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: rangeDetails
|
id: rangeDetails
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: rangeMover
|
id: rangeMover
|
||||||
|
@@ -23,9 +23,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: button
|
id: button
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
|
|
||||||
RangeMover {
|
RangeMover {
|
||||||
id: selectionRange
|
id: selectionRange
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
|
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: selectionRangeDetails
|
id: selectionRangeDetails
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: timeDisplay
|
id: timeDisplay
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: timeMarks
|
id: timeMarks
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
import QtQml.Models 2.1
|
import QtQml.Models
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: flick
|
id: flick
|
||||||
|
@@ -23,9 +23,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtQml.Models 2.1
|
import QtQml.Models
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: categories
|
id: categories
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: rulersParent
|
id: rulersParent
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtCreator.Tracing 1.0
|
import QtCreator.Tracing
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
varying lowp vec4 color;
|
|
||||||
varying lowp float d;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_FragColor = color * float(d < (2.0 / 3.0) || d > (5.0 / 6.0));
|
|
||||||
}
|
|
@@ -1,42 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
attribute vec4 vertexCoord;
|
|
||||||
attribute float distanceFromTop;
|
|
||||||
|
|
||||||
uniform mat4 matrix;
|
|
||||||
uniform vec4 notesColor;
|
|
||||||
|
|
||||||
varying vec4 color;
|
|
||||||
varying float d;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = matrix * vertexCoord;
|
|
||||||
gl_Position.z -= 0.1;
|
|
||||||
gl_Position.w = 1.0;
|
|
||||||
color = notesColor;
|
|
||||||
d = distanceFromTop;
|
|
||||||
}
|
|
@@ -1,44 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef GL_OES_standard_derivatives
|
|
||||||
#extension GL_OES_standard_derivatives : enable
|
|
||||||
// else we probably have fwidth() in core
|
|
||||||
#endif
|
|
||||||
|
|
||||||
varying lowp vec3 edgeColor;
|
|
||||||
varying lowp vec3 color;
|
|
||||||
varying lowp vec2 barycentric;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
lowp vec2 d = fwidth(barycentric) * 4.0;
|
|
||||||
lowp vec4 edge_closeness = step(vec4(d.x, d.y, d.x, d.y),
|
|
||||||
vec4(barycentric.x, barycentric.y, 1.0 - barycentric.x, 1.0 - barycentric.y));
|
|
||||||
lowp float total = min(min(edge_closeness[0], edge_closeness[1]),
|
|
||||||
min(edge_closeness[2], edge_closeness[3]));
|
|
||||||
gl_FragColor.rgb = mix(edgeColor, color, total);
|
|
||||||
gl_FragColor.a = 1.0;
|
|
||||||
}
|
|
@@ -1,59 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
attribute vec4 vertexCoord;
|
|
||||||
attribute vec2 rectSize;
|
|
||||||
attribute float selectionId;
|
|
||||||
attribute vec4 vertexColor;
|
|
||||||
|
|
||||||
uniform vec2 scale;
|
|
||||||
uniform mat4 matrix;
|
|
||||||
uniform vec4 selectionColor;
|
|
||||||
uniform float selectedItem;
|
|
||||||
|
|
||||||
varying vec3 color;
|
|
||||||
varying vec3 edgeColor;
|
|
||||||
varying vec2 barycentric;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = matrix * vertexCoord;
|
|
||||||
|
|
||||||
// Make very narrow events somewhat wider so that they don't collapse into 0 pixels
|
|
||||||
float scaledWidth = scale.x * rectSize.x;
|
|
||||||
float shift = sign(rectSize.x) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005;
|
|
||||||
gl_Position.x += shift;
|
|
||||||
|
|
||||||
// Ditto for events with very small height
|
|
||||||
float scaledHeight = scale.y * rectSize.y;
|
|
||||||
gl_Position.y += float(rectSize.y > 0.0) * max(0.0, 3.0 - scaledHeight) * 0.003;
|
|
||||||
|
|
||||||
barycentric = vec2(rectSize.x > 0.0 ? 1.0 : 0.0, rectSize.y > 0.0 ? 1.0 : 0.0);
|
|
||||||
color = vertexColor.rgb;
|
|
||||||
float selected = min(1.0, abs(selectionId - selectedItem));
|
|
||||||
edgeColor = mix(selectionColor.rgb, vertexColor.rgb, selected);
|
|
||||||
gl_Position.z += mix(0.0, (shift + 0.0015) / 10.0, selected);
|
|
||||||
gl_Position.w = 1.0;
|
|
||||||
}
|
|
@@ -30,26 +30,12 @@
|
|||||||
#include <QOpenGLContext>
|
#include <QOpenGLContext>
|
||||||
#include <QOffscreenSurface>
|
#include <QOffscreenSurface>
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
#include <QSGEngine>
|
|
||||||
#include <QSGAbstractRenderer>
|
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
namespace Timeline {
|
namespace Timeline {
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
static void renderMessageHandler(QtMsgType type, const QMessageLogContext &context,
|
|
||||||
const QString &message)
|
|
||||||
{
|
|
||||||
if (type > QtDebugMsg)
|
|
||||||
QTest::qFail(message.toLatin1().constData(), context.file, context.line);
|
|
||||||
else
|
|
||||||
QTest::qWarn(message.toLatin1().constData(), context.file, context.line);
|
|
||||||
}
|
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
void runSceneGraphTest(QSGNode *node)
|
void runSceneGraphTest(QSGNode *node)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(node)
|
||||||
|
|
||||||
QSurfaceFormat format;
|
QSurfaceFormat format;
|
||||||
format.setStencilBufferSize(8);
|
format.setStencilBufferSize(8);
|
||||||
format.setDepthBufferSize(24);
|
format.setDepthBufferSize(24);
|
||||||
@@ -64,26 +50,6 @@ void runSceneGraphTest(QSGNode *node)
|
|||||||
|
|
||||||
QVERIFY(context.makeCurrent(&surface));
|
QVERIFY(context.makeCurrent(&surface));
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGEngine engine;
|
|
||||||
QSGRootNode root;
|
|
||||||
root.appendChildNode(node);
|
|
||||||
engine.initialize(&context);
|
|
||||||
|
|
||||||
QSGAbstractRenderer *renderer = engine.createRenderer();
|
|
||||||
QVERIFY(renderer != 0);
|
|
||||||
renderer->setRootNode(&root);
|
|
||||||
QtMessageHandler originalHandler = qInstallMessageHandler(renderMessageHandler);
|
|
||||||
renderer->renderScene();
|
|
||||||
qInstallMessageHandler(originalHandler);
|
|
||||||
delete renderer;
|
|
||||||
|
|
||||||
// Unfortunately we cannot check the results of the rendering. But at least we know the shaders
|
|
||||||
// have not crashed here.
|
|
||||||
#else
|
|
||||||
Q_UNUSED(node)
|
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
context.doneCurrent();
|
context.doneCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,14 +86,4 @@ QString formatTime(qint64 timestamp, qint64 reference)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimeFormatter::setupTimeFormatter()
|
|
||||||
{
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
static const int typeIndex = qmlRegisterSingletonType<TimeFormatter>(
|
|
||||||
"QtCreator.Tracing", 1, 0, "TimeFormatter",
|
|
||||||
[](QQmlEngine *, QJSEngine *){ return new TimeFormatter; });
|
|
||||||
Q_UNUSED(typeIndex)
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -36,18 +36,14 @@ QString TRACING_EXPORT formatTime(qint64 timestamp,
|
|||||||
|
|
||||||
class TRACING_EXPORT TimeFormatter : public QObject {
|
class TRACING_EXPORT TimeFormatter : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE QString format(qint64 timestamp, qint64 reference)
|
Q_INVOKABLE QString format(qint64 timestamp, qint64 reference)
|
||||||
{
|
{
|
||||||
return formatTime(timestamp, reference);
|
return formatTime(timestamp, reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setupTimeFormatter();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -45,11 +45,7 @@ public:
|
|||||||
void setSelectionColor(QColor selectionColor);
|
void setSelectionColor(QColor selectionColor);
|
||||||
|
|
||||||
QSGMaterialType *type() const override;
|
QSGMaterialType *type() const override;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *createShader() const override;
|
|
||||||
#else
|
|
||||||
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
|
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector2D m_scale;
|
QVector2D m_scale;
|
||||||
|
@@ -54,9 +54,7 @@ class TRACING_EXPORT TimelineModel : public QObject
|
|||||||
Q_PROPERTY(QVariantList labels READ labels NOTIFY labelsChanged)
|
Q_PROPERTY(QVariantList labels READ labels NOTIFY labelsChanged)
|
||||||
Q_PROPERTY(int count READ count NOTIFY contentChanged)
|
Q_PROPERTY(int count READ count NOTIFY contentChanged)
|
||||||
Q_PROPERTY(int defaultRowHeight READ defaultRowHeight CONSTANT)
|
Q_PROPERTY(int defaultRowHeight READ defaultRowHeight CONSTANT)
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class TimelineModelPrivate;
|
class TimelineModelPrivate;
|
||||||
|
@@ -36,9 +36,7 @@ class TRACING_EXPORT TimelineNotesModel : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int count READ count NOTIFY changed)
|
Q_PROPERTY(int count READ count NOTIFY changed)
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TimelineNotesModel(QObject *parent = nullptr);
|
TimelineNotesModel(QObject *parent = nullptr);
|
||||||
|
@@ -41,11 +41,7 @@ class NotesMaterial : public QSGMaterial
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QSGMaterialType *type() const final;
|
QSGMaterialType *type() const final;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *createShader() const final;
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const final;
|
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const final;
|
||||||
#endif // < Qt 6
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NotesGeometry
|
struct NotesGeometry
|
||||||
@@ -180,9 +176,9 @@ TimelineNotesRenderPassState::TimelineNotesRenderPassState(int numExpandedRows)
|
|||||||
m_material.setFlag(QSGMaterial::Blending, true);
|
m_material.setFlag(QSGMaterial::Blending, true);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||||
m_material.setFlag(QSGMaterial::NoBatching, true);
|
m_material.setFlag(QSGMaterial::NoBatching, true);
|
||||||
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#else
|
||||||
m_material.setFlag(QSGMaterial::CustomCompileStep, true);
|
m_material.setFlag(QSGMaterial::CustomCompileStep, true);
|
||||||
#endif // >= Qt 6.3/6.0
|
#endif // >= Qt 6.3
|
||||||
m_expandedRows.reserve(numExpandedRows);
|
m_expandedRows.reserve(numExpandedRows);
|
||||||
for (int i = 0; i < numExpandedRows; ++i)
|
for (int i = 0; i < numExpandedRows; ++i)
|
||||||
m_expandedRows << createNode();
|
m_expandedRows << createNode();
|
||||||
@@ -234,34 +230,14 @@ class NotesMaterialShader : public QSGMaterialShader
|
|||||||
public:
|
public:
|
||||||
NotesMaterialShader();
|
NotesMaterialShader();
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void updateState(const RenderState &state, QSGMaterial *newEffect,
|
|
||||||
QSGMaterial *oldEffect) override;
|
|
||||||
char const *const *attributeNames() const override;
|
|
||||||
#else // < Qt 6
|
|
||||||
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
|
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
private:
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void initialize() override;
|
|
||||||
|
|
||||||
int m_matrix_id;
|
|
||||||
int m_z_range_id;
|
|
||||||
int m_color_id;
|
|
||||||
#endif // < Qt 6
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NotesMaterialShader::NotesMaterialShader()
|
NotesMaterialShader::NotesMaterialShader()
|
||||||
: QSGMaterialShader()
|
: QSGMaterialShader()
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/QtCreator/Tracing/notes.vert"));
|
|
||||||
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/QtCreator/Tracing/notes.frag"));
|
|
||||||
#else // < Qt 6
|
|
||||||
setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes_qt6.vert.qsb");
|
setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes_qt6.vert.qsb");
|
||||||
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes_qt6.frag.qsb");
|
setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes_qt6.frag.qsb");
|
||||||
#endif // < Qt 6
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static QColor notesColor()
|
static QColor notesColor()
|
||||||
@@ -271,16 +247,6 @@ static QColor notesColor()
|
|||||||
: QColor(255, 165, 0);
|
: QColor(255, 165, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void NotesMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)
|
|
||||||
{
|
|
||||||
if (state.isMatrixDirty()) {
|
|
||||||
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
|
|
||||||
program()->setUniformValue(m_z_range_id, GLfloat(1.0));
|
|
||||||
program()->setUniformValue(m_color_id, notesColor());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else // < Qt 6
|
|
||||||
bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
|
bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
|
||||||
{
|
{
|
||||||
QByteArray *buf = state.uniformData();
|
QByteArray *buf = state.uniformData();
|
||||||
@@ -298,22 +264,6 @@ bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, Q
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
char const *const *NotesMaterialShader::attributeNames() const
|
|
||||||
{
|
|
||||||
static const char *const attr[] = {"vertexCoord", "distanceFromTop", nullptr};
|
|
||||||
return attr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void NotesMaterialShader::initialize()
|
|
||||||
{
|
|
||||||
m_matrix_id = program()->uniformLocation("matrix");
|
|
||||||
m_z_range_id = program()->uniformLocation("_qt_zRange");
|
|
||||||
m_color_id = program()->uniformLocation("notesColor");
|
|
||||||
}
|
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
QSGMaterialType *NotesMaterial::type() const
|
QSGMaterialType *NotesMaterial::type() const
|
||||||
{
|
{
|
||||||
@@ -321,11 +271,7 @@ QSGMaterialType *NotesMaterial::type() const
|
|||||||
return &type;
|
return &type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *NotesMaterial::createShader() const
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *NotesMaterial::createShader(QSGRendererInterface::RenderMode) const
|
QSGMaterialShader *NotesMaterial::createShader(QSGRendererInterface::RenderMode) const
|
||||||
#endif // < Qt 6
|
|
||||||
{
|
{
|
||||||
return new NotesMaterialShader;
|
return new NotesMaterialShader;
|
||||||
}
|
}
|
||||||
|
@@ -32,9 +32,7 @@ namespace Timeline {
|
|||||||
class TRACING_EXPORT TimelineOverviewRenderer : public TimelineAbstractRenderer
|
class TRACING_EXPORT TimelineOverviewRenderer : public TimelineAbstractRenderer
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TimelineOverviewRenderer(QQuickItem *parent = nullptr);
|
TimelineOverviewRenderer(QQuickItem *parent = nullptr);
|
||||||
|
@@ -38,9 +38,7 @@ namespace Timeline {
|
|||||||
class TRACING_EXPORT TimelineRenderer : public TimelineAbstractRenderer
|
class TRACING_EXPORT TimelineRenderer : public TimelineAbstractRenderer
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimelineRenderer(QQuickItem *parent = nullptr);
|
explicit TimelineRenderer(QQuickItem *parent = nullptr);
|
||||||
|
@@ -107,12 +107,6 @@ TimelineTheme::TimelineTheme(QObject *parent)
|
|||||||
|
|
||||||
void TimelineTheme::setupTheme(QQmlEngine *engine)
|
void TimelineTheme::setupTheme(QQmlEngine *engine)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
static const int typeIndex = qmlRegisterSingletonType<Utils::Theme>(
|
|
||||||
"QtCreator.Tracing", 1, 0, "Theme",
|
|
||||||
[](QQmlEngine *, QJSEngine *){ return Utils::proxyTheme(); });
|
|
||||||
Q_UNUSED(typeIndex)
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
engine->addImageProvider(QLatin1String("icons"), new TimelineImageIconProvider);
|
engine->addImageProvider(QLatin1String("icons"), new TimelineImageIconProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,10 +37,8 @@ namespace Timeline {
|
|||||||
class TRACING_EXPORT TimelineTheme : public Utils::Theme
|
class TRACING_EXPORT TimelineTheme : public Utils::Theme
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_NAMED_ELEMENT(Theme)
|
QML_NAMED_ELEMENT(Theme)
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimelineTheme(QObject *parent = nullptr);
|
explicit TimelineTheme(QObject *parent = nullptr);
|
||||||
|
@@ -56,9 +56,7 @@ class TRACING_EXPORT TimelineZoomControl : public QObject {
|
|||||||
Q_PROPERTY(qint64 maximumZoomFactor READ maximumZoomFactor CONSTANT)
|
Q_PROPERTY(qint64 maximumZoomFactor READ maximumZoomFactor CONSTANT)
|
||||||
Q_PROPERTY(qint64 minimumRangeLength READ minimumRangeLength CONSTANT)
|
Q_PROPERTY(qint64 minimumRangeLength READ minimumRangeLength CONSTANT)
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
#endif // Qt >= 6.2
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qint64 maximumZoomFactor() const { return 1 << 10; }
|
qint64 maximumZoomFactor() const { return 1 << 10; }
|
||||||
|
@@ -40,9 +40,10 @@ Project {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "QML"
|
name: "Qml Files"
|
||||||
prefix: "qml/"
|
Qt.core.resourcePrefix: "QtCreator/Tracing/"
|
||||||
files: ["tracing.qrc"]
|
fileTags: "qt.core.resource_data"
|
||||||
|
files: "qml/**"
|
||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
@@ -43,16 +43,6 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo
|
|||||||
: QQuickWidget(parent)
|
: QQuickWidget(parent)
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("CtfVisualizerTraceView"));
|
setObjectName(QLatin1String("CtfVisualizerTraceView"));
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<Timeline::TimelineRenderer>("QtCreator.Tracing", 1, 0, "TimelineRenderer");
|
|
||||||
qmlRegisterType<Timeline::TimelineOverviewRenderer>("QtCreator.Tracing", 1, 0,
|
|
||||||
"TimelineOverviewRenderer");
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineZoomControl>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineModel>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineNotesModel>("QtCreator.Tracing", 1);
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
@@ -60,7 +50,6 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo
|
|||||||
setMinimumHeight(170);
|
setMinimumHeight(170);
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(engine());
|
Timeline::TimelineTheme::setupTheme(engine());
|
||||||
Timeline::TimeFormatter::setupTimeFormatter();
|
|
||||||
|
|
||||||
rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
||||||
tool->modelAggregator());
|
tool->modelAggregator());
|
||||||
|
@@ -39,40 +39,29 @@ set(PERFPROFILER_CPP_SOURCES
|
|||||||
perftracepointdialog.cpp perftracepointdialog.h perftracepointdialog.ui
|
perftracepointdialog.cpp perftracepointdialog.h perftracepointdialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
add_qtc_plugin(PerfProfiler
|
||||||
add_qtc_plugin(PerfProfiler
|
CONDITION TARGET Tracing
|
||||||
DEPENDS Tracing Qt5::QuickWidgets
|
DEPENDS Tracing Qt5::QuickWidgets
|
||||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
|
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
|
||||||
SOURCES
|
SOURCES
|
||||||
${TEST_SOURCES}
|
${TEST_SOURCES}
|
||||||
${PERFPROFILER_CPP_SOURCES}
|
)
|
||||||
perfprofiler.qrc
|
|
||||||
)
|
|
||||||
else() # < Qt 6.2
|
|
||||||
add_qtc_plugin(PerfProfiler
|
|
||||||
CONDITION TARGET Tracing
|
|
||||||
DEPENDS Tracing Qt5::QuickWidgets
|
|
||||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
|
|
||||||
SOURCES
|
|
||||||
${TEST_SOURCES}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT TARGET PerfProfiler)
|
if (NOT TARGET PerfProfiler)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_add_resources(PerfProfiler perfprofiler
|
qt_add_resources(PerfProfiler perfprofiler
|
||||||
PREFIX "/perfprofiler"
|
PREFIX "/perfprofiler"
|
||||||
tracepoints.sh
|
tracepoints.sh
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_add_qml_module(PerfProfiler
|
qt_add_qml_module(PerfProfiler
|
||||||
URI "QtCreator.PerfProfiler"
|
URI "QtCreator.PerfProfiler"
|
||||||
VERSION "1.0"
|
VERSION "1.0"
|
||||||
NO_PLUGIN
|
NO_PLUGIN
|
||||||
QML_FILES
|
QML_FILES
|
||||||
PerfProfilerFlameGraphView.qml
|
PerfProfilerFlameGraphView.qml
|
||||||
SOURCES
|
SOURCES
|
||||||
${PERFPROFILER_CPP_SOURCES}
|
${PERFPROFILER_CPP_SOURCES}
|
||||||
)
|
)
|
||||||
endif() # < Qt 6.2
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtCreator.PerfProfiler 1.0
|
import QtCreator.PerfProfiler
|
||||||
import "../Tracing" // TODO: Turn into module import when possible
|
import "../Tracing" // TODO: Turn into module import when possible
|
||||||
|
|
||||||
FlameGraphView {
|
FlameGraphView {
|
||||||
|
@@ -70,6 +70,13 @@ QtcPlugin {
|
|||||||
"perfprofiler.qrc",
|
"perfprofiler.qrc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Group {
|
||||||
|
name: "Qml Files"
|
||||||
|
Qt.core.resourcePrefix: "QtCreator/PerfProfiler/"
|
||||||
|
fileTags: "qt.core.resource_data"
|
||||||
|
files: [ "PerfProfilerFlameGraphView.qml" ]
|
||||||
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "Unit tests"
|
name: "Unit tests"
|
||||||
condition: qtc.testsEnabled
|
condition: qtc.testsEnabled
|
||||||
|
@@ -2,7 +2,4 @@
|
|||||||
<qresource prefix="/perfprofiler">
|
<qresource prefix="/perfprofiler">
|
||||||
<file>tracepoints.sh</file>
|
<file>tracepoints.sh</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/QtCreator/PerfProfiler">
|
|
||||||
<file>PerfProfilerFlameGraphView.qml</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -39,10 +39,8 @@ class PerfProfilerFlameGraphData;
|
|||||||
class PerfProfilerFlameGraphModel : public QAbstractItemModel
|
class PerfProfilerFlameGraphModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
QML_UNCREATABLE("use the context property")
|
QML_UNCREATABLE("use the context property")
|
||||||
#endif // Qt >= 6.2
|
|
||||||
Q_DISABLE_COPY(PerfProfilerFlameGraphModel);
|
Q_DISABLE_COPY(PerfProfilerFlameGraphModel);
|
||||||
public:
|
public:
|
||||||
PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete;
|
PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete;
|
||||||
|
@@ -45,13 +45,6 @@ PerfProfilerFlameGraphView::PerfProfilerFlameGraphView(QWidget *parent, PerfProf
|
|||||||
PerfProfilerTraceManager *manager = tool->traceManager();
|
PerfProfilerTraceManager *manager = tool->traceManager();
|
||||||
m_model = new PerfProfilerFlameGraphModel(manager);
|
m_model = new PerfProfilerFlameGraphModel(manager);
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<FlameGraph::FlameGraph>("QtCreator.Tracing", 1, 0, "FlameGraph");
|
|
||||||
qmlRegisterUncreatableType<PerfProfilerFlameGraphModel>(
|
|
||||||
"QtCreator.PerfProfiler", 1, 0, "PerfProfilerFlameGraphModel",
|
|
||||||
QLatin1String("use the context property"));
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(engine());
|
Timeline::TimelineTheme::setupTheme(engine());
|
||||||
|
|
||||||
rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
||||||
|
@@ -41,16 +41,6 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool *
|
|||||||
: QQuickWidget(parent)
|
: QQuickWidget(parent)
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("PerfProfilerTraceView"));
|
setObjectName(QLatin1String("PerfProfilerTraceView"));
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<Timeline::TimelineRenderer>("QtCreator.Tracing", 1, 0, "TimelineRenderer");
|
|
||||||
qmlRegisterType<Timeline::TimelineOverviewRenderer>("QtCreator.Tracing", 1, 0,
|
|
||||||
"TimelineOverviewRenderer");
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineZoomControl>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineModel>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineNotesModel>("QtCreator.Tracing", 1);
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
@@ -58,7 +48,6 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool *
|
|||||||
setMinimumHeight(170);
|
setMinimumHeight(170);
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(engine());
|
Timeline::TimelineTheme::setupTheme(engine());
|
||||||
Timeline::TimeFormatter::setupTimeFormatter();
|
|
||||||
|
|
||||||
rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
||||||
tool->modelManager());
|
tool->modelManager());
|
||||||
@@ -76,11 +65,7 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool *
|
|||||||
|
|
||||||
bool PerfProfilerTraceView::isUsable() const
|
bool PerfProfilerTraceView::isUsable() const
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
return quickWindow()->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
|
|
||||||
#else
|
|
||||||
return QSGRendererInterface::isApiRhiBased(quickWindow()->rendererInterface()->graphicsApi());
|
return QSGRendererInterface::isApiRhiBased(quickWindow()->rendererInterface()->graphicsApi());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerfProfilerTraceView::selectByTypeId(int typeId)
|
void PerfProfilerTraceView::selectByTypeId(int typeId)
|
||||||
|
@@ -71,59 +71,48 @@ set(QMLPROFILER_CPP_SOURCES
|
|||||||
quick3dmodel.cpp quick3dmodel.h
|
quick3dmodel.cpp quick3dmodel.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
find_package(Qt6 COMPONENTS ShaderTools QUIET)
|
||||||
add_qtc_plugin(QmlProfiler
|
|
||||||
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets Utils
|
|
||||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
|
|
||||||
SOURCES
|
|
||||||
${TEST_SOURCES}
|
|
||||||
${QMLPROFILER_CPP_SOURCES}
|
|
||||||
qml/qmlprofiler.qrc
|
|
||||||
)
|
|
||||||
else() # < Qt 6.2
|
|
||||||
find_package(Qt6 COMPONENTS ShaderTools QUIET)
|
|
||||||
|
|
||||||
add_qtc_plugin(QmlProfiler
|
add_qtc_plugin(QmlProfiler
|
||||||
CONDITION TARGET Tracing AND TARGET Qt6::ShaderTools
|
CONDITION TARGET Tracing AND TARGET Qt6::ShaderTools
|
||||||
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
|
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
|
||||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
|
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
|
||||||
SOURCES
|
SOURCES
|
||||||
${TEST_SOURCES}
|
${TEST_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT TARGET QmlProfiler)
|
if (NOT TARGET QmlProfiler)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(QMLPROFILER_QML_FILES
|
set(QMLPROFILER_QML_FILES
|
||||||
qml/QmlProfilerFlameGraphView.qml
|
qml/QmlProfilerFlameGraphView.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(file IN LISTS QMLPROFILER_QML_FILES)
|
foreach(file IN LISTS QMLPROFILER_QML_FILES)
|
||||||
get_filename_component(fileName "${file}" NAME)
|
get_filename_component(fileName "${file}" NAME)
|
||||||
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
|
set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
qt_add_shaders(QmlProfiler "res_qmlprofilershaders"
|
qt_add_shaders(QmlProfiler "res_qmlprofilershaders"
|
||||||
BATCHABLE
|
BATCHABLE
|
||||||
PREFIX
|
PREFIX
|
||||||
"/QtCreator/QmlProfiler"
|
"/QtCreator/QmlProfiler"
|
||||||
BASE
|
BASE
|
||||||
"qml"
|
"qml"
|
||||||
FILES
|
FILES
|
||||||
qml/bindingloops_qt6.frag
|
qml/bindingloops_qt6.frag
|
||||||
qml/bindingloops_qt6.vert
|
qml/bindingloops_qt6.vert
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_add_qml_module(QmlProfiler
|
qt_add_qml_module(QmlProfiler
|
||||||
URI "QtCreator.QmlProfiler"
|
URI "QtCreator.QmlProfiler"
|
||||||
VERSION "1.0"
|
VERSION "1.0"
|
||||||
NO_PLUGIN
|
NO_PLUGIN
|
||||||
QML_FILES
|
QML_FILES
|
||||||
${QMLPROFILER_QML_FILES}
|
${QMLPROFILER_QML_FILES}
|
||||||
RESOURCES
|
RESOURCES
|
||||||
${QMLPROFILER_QML_RESOURCES}
|
${QMLPROFILER_QML_RESOURCES}
|
||||||
SOURCES
|
SOURCES
|
||||||
${QMLPROFILER_CPP_SOURCES}
|
${QMLPROFILER_CPP_SOURCES}
|
||||||
)
|
)
|
||||||
endif() # < Qt 6.2
|
|
||||||
|
@@ -55,10 +55,8 @@ struct FlameGraphData {
|
|||||||
class FlameGraphModel : public QAbstractItemModel
|
class FlameGraphModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_NAMED_ELEMENT(QmlProfilerFlameGraphModel)
|
QML_NAMED_ELEMENT(QmlProfilerFlameGraphModel)
|
||||||
QML_UNCREATABLE("use the context property")
|
QML_UNCREATABLE("use the context property")
|
||||||
#endif // Qt >= 6.2
|
|
||||||
public:
|
public:
|
||||||
enum Role {
|
enum Role {
|
||||||
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string
|
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string
|
||||||
|
@@ -46,13 +46,6 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
|
|||||||
setObjectName("QmlProfiler.FlameGraph.Dock");
|
setObjectName("QmlProfiler.FlameGraph.Dock");
|
||||||
setWindowTitle(tr("Flame Graph"));
|
setWindowTitle(tr("Flame Graph"));
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<FlameGraph::FlameGraph>("QtCreator.Tracing", 1, 0, "FlameGraph");
|
|
||||||
qmlRegisterUncreatableType<FlameGraphModel>("QtCreator.QmlProfiler", 1, 0,
|
|
||||||
"QmlProfilerFlameGraphModel",
|
|
||||||
QLatin1String("use the context property"));
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(m_content->engine());
|
Timeline::TimelineTheme::setupTheme(m_content->engine());
|
||||||
|
|
||||||
m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model);
|
||||||
|
@@ -72,12 +72,7 @@ QVariantList InputEventsModel::labels() const
|
|||||||
|
|
||||||
QMetaEnum InputEventsModel::metaEnum(const char *name)
|
QMetaEnum InputEventsModel::metaEnum(const char *name)
|
||||||
{
|
{
|
||||||
return
|
return Qt::staticMetaObject.enumerator(Qt::staticMetaObject.indexOfEnumerator(name));
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
staticQtMetaObject.enumerator(staticQtMetaObject.indexOfEnumerator(name));
|
|
||||||
#else // < Qt 6
|
|
||||||
Qt::staticMetaObject.enumerator(Qt::staticMetaObject.indexOfEnumerator(name));
|
|
||||||
#endif // < Qt 6
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap InputEventsModel::details(int index) const
|
QVariantMap InputEventsModel::details(int index) const
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtCreator.QmlProfiler 1.0
|
import QtCreator.QmlProfiler
|
||||||
import "../Tracing" // TODO: Turn into module import when possible
|
import "../Tracing" // TODO: Turn into module import when possible
|
||||||
|
|
||||||
FlameGraphView {
|
FlameGraphView {
|
||||||
|
@@ -1,31 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
varying lowp vec4 color;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_FragColor = color;
|
|
||||||
}
|
|
@@ -1,42 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
attribute vec4 vertexCoord;
|
|
||||||
attribute vec2 postScaleOffset;
|
|
||||||
|
|
||||||
uniform mat4 matrix;
|
|
||||||
uniform vec4 bindingLoopsColor;
|
|
||||||
|
|
||||||
varying vec4 color;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = matrix * vertexCoord;
|
|
||||||
gl_Position.x += postScaleOffset.x * 0.005;
|
|
||||||
gl_Position.y += postScaleOffset.y * 0.01;
|
|
||||||
gl_Position.z -= 0.1;
|
|
||||||
gl_Position.w = 1.0;
|
|
||||||
color = bindingLoopsColor;
|
|
||||||
}
|
|
@@ -1,7 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/QtCreator/QmlProfiler">
|
|
||||||
<file>bindingloops.vert</file>
|
|
||||||
<file>bindingloops.frag</file>
|
|
||||||
<file>QmlProfilerFlameGraphView.qml</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
@@ -65,9 +65,10 @@ QtcPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "QML"
|
name: "Qml Files"
|
||||||
prefix: "qml/"
|
Qt.core.resourcePrefix: "QtCreator/QmlProfiler/"
|
||||||
files: ["qmlprofiler.qrc"]
|
fileTags: "qt.core.resource_data"
|
||||||
|
files: "qml/**"
|
||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
@@ -34,11 +34,7 @@ namespace Internal {
|
|||||||
class BindingLoopMaterial : public QSGMaterial {
|
class BindingLoopMaterial : public QSGMaterial {
|
||||||
public:
|
public:
|
||||||
QSGMaterialType *type() const override;
|
QSGMaterialType *type() const override;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *createShader() const override;
|
|
||||||
#else
|
|
||||||
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
|
QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
|
||||||
#endif // < Qt 6
|
|
||||||
BindingLoopMaterial();
|
BindingLoopMaterial();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -299,36 +295,14 @@ class BindingLoopMaterialShader : public QSGMaterialShader
|
|||||||
public:
|
public:
|
||||||
BindingLoopMaterialShader();
|
BindingLoopMaterialShader();
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void updateState(const RenderState &state, QSGMaterial *newEffect,
|
|
||||||
QSGMaterial *oldEffect) override;
|
|
||||||
char const *const *attributeNames() const override;
|
|
||||||
#else // < Qt 6
|
|
||||||
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
|
bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override;
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
private:
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void initialize() override;
|
|
||||||
|
|
||||||
int m_matrix_id = 0;
|
|
||||||
int m_z_range_id = 0;
|
|
||||||
int m_color_id = 0;
|
|
||||||
#endif // < Qt 6
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BindingLoopMaterialShader::BindingLoopMaterialShader()
|
BindingLoopMaterialShader::BindingLoopMaterialShader()
|
||||||
: QSGMaterialShader()
|
: QSGMaterialShader()
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
setShaderSourceFile(QOpenGLShader::Vertex,
|
|
||||||
QStringLiteral(":/QtCreator/QmlProfiler/bindingloops.vert"));
|
|
||||||
setShaderSourceFile(QOpenGLShader::Fragment,
|
|
||||||
QStringLiteral(":/QtCreator/QmlProfiler/bindingloops.frag"));
|
|
||||||
#else // < Qt 6
|
|
||||||
setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb");
|
setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb");
|
||||||
setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb");
|
setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb");
|
||||||
#endif // < Qt 6
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static QColor bindingLoopsColor()
|
static QColor bindingLoopsColor()
|
||||||
@@ -336,16 +310,6 @@ static QColor bindingLoopsColor()
|
|||||||
return Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor);
|
return Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void BindingLoopMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)
|
|
||||||
{
|
|
||||||
if (state.isMatrixDirty()) {
|
|
||||||
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
|
|
||||||
program()->setUniformValue(m_z_range_id, GLfloat(1.0));
|
|
||||||
program()->setUniformValue(m_color_id, bindingLoopsColor());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else // < Qt 6
|
|
||||||
bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
|
bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *)
|
||||||
{
|
{
|
||||||
QByteArray *buf = state.uniformData();
|
QByteArray *buf = state.uniformData();
|
||||||
@@ -363,31 +327,15 @@ bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMateria
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
char const *const *BindingLoopMaterialShader::attributeNames() const
|
|
||||||
{
|
|
||||||
static const char *const attr[] = {"vertexCoord", "postScaleOffset", nullptr};
|
|
||||||
return attr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BindingLoopMaterialShader::initialize()
|
|
||||||
{
|
|
||||||
m_matrix_id = program()->uniformLocation("matrix");
|
|
||||||
m_z_range_id = program()->uniformLocation("_qt_zRange");
|
|
||||||
m_color_id = program()->uniformLocation("bindingLoopsColor");
|
|
||||||
}
|
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
BindingLoopMaterial::BindingLoopMaterial()
|
BindingLoopMaterial::BindingLoopMaterial()
|
||||||
{
|
{
|
||||||
setFlag(QSGMaterial::Blending, false);
|
setFlag(QSGMaterial::Blending, false);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||||
setFlag(QSGMaterial::NoBatching, true);
|
setFlag(QSGMaterial::NoBatching, true);
|
||||||
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#else
|
||||||
setFlag(QSGMaterial::CustomCompileStep, true);
|
setFlag(QSGMaterial::CustomCompileStep, true);
|
||||||
#endif // >= Qt 6.3/6.0
|
#endif // >= Qt 6.3
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGMaterialType *BindingLoopMaterial::type() const
|
QSGMaterialType *BindingLoopMaterial::type() const
|
||||||
@@ -396,11 +344,7 @@ QSGMaterialType *BindingLoopMaterial::type() const
|
|||||||
return &type;
|
return &type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *BindingLoopMaterial::createShader() const
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *BindingLoopMaterial::createShader(QSGRendererInterface::RenderMode) const
|
QSGMaterialShader *BindingLoopMaterial::createShader(QSGRendererInterface::RenderMode) const
|
||||||
#endif // < Qt 6
|
|
||||||
{
|
{
|
||||||
return new BindingLoopMaterialShader;
|
return new BindingLoopMaterialShader;
|
||||||
}
|
}
|
||||||
|
@@ -123,15 +123,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
|
|||||||
groupLayout->setContentsMargins(0, 0, 0, 0);
|
groupLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
groupLayout->setSpacing(0);
|
groupLayout->setSpacing(0);
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<Timeline::TimelineRenderer>("QtCreator.Tracing", 1, 0, "TimelineRenderer");
|
|
||||||
qmlRegisterType<Timeline::TimelineOverviewRenderer>("QtCreator.Tracing", 1, 0,
|
|
||||||
"TimelineOverviewRenderer");
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineZoomControl>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineModel>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<Timeline::TimelineNotesModel>("QtCreator.Tracing", 1);
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
d->m_mainView = new QQuickWidget(this);
|
d->m_mainView = new QQuickWidget(this);
|
||||||
d->m_mainView->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
d->m_mainView->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
d->m_mainView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
d->m_mainView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
@@ -169,7 +160,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
|
|||||||
setMinimumHeight(170);
|
setMinimumHeight(170);
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(d->m_mainView->engine());
|
Timeline::TimelineTheme::setupTheme(d->m_mainView->engine());
|
||||||
Timeline::TimeFormatter::setupTimeFormatter();
|
|
||||||
|
|
||||||
d->m_mainView->rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
d->m_mainView->rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"),
|
||||||
d->m_modelProxy);
|
d->m_modelProxy);
|
||||||
@@ -298,12 +288,9 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
|
|||||||
|
|
||||||
bool QmlProfilerTraceView::isUsable() const
|
bool QmlProfilerTraceView::isUsable() const
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
const QSGRendererInterface::GraphicsApi api =
|
||||||
return d->m_mainView->quickWindow()->rendererInterface()->graphicsApi()
|
d->m_mainView->quickWindow()->rendererInterface()->graphicsApi();
|
||||||
== QSGRendererInterface::OpenGL;
|
return QSGRendererInterface::isApiRhiBased(api);
|
||||||
#else
|
|
||||||
return QSGRendererInterface::isApiRhiBased(d->m_mainView->quickWindow()->rendererInterface()->graphicsApi());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlProfilerTraceView::isSuspended() const
|
bool QmlProfilerTraceView::isSuspended() const
|
||||||
|
@@ -119,18 +119,10 @@ void QmlProfilerBindingLoopsRenderPassTest::testUpdate()
|
|||||||
QCOMPARE(node->geometry()->vertexCount(), 7 * 18);
|
QCOMPARE(node->geometry()->vertexCount(), 7 * 18);
|
||||||
QVERIFY(material2 != nullptr);
|
QVERIFY(material2 != nullptr);
|
||||||
QCOMPARE(material1->type(), material2->type());
|
QCOMPARE(material1->type(), material2->type());
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader();
|
|
||||||
QVERIFY(shader1 != nullptr);
|
|
||||||
QSGMaterialShader *shader2 = material2->createShader();
|
|
||||||
QVERIFY(shader2 != nullptr);
|
|
||||||
QCOMPARE(shader1->attributeNames(), shader2->attributeNames());
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader1 != 0);
|
QVERIFY(shader1 != 0);
|
||||||
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader2 != 0);
|
QVERIFY(shader2 != 0);
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
delete shader1;
|
delete shader1;
|
||||||
delete shader2;
|
delete shader2;
|
||||||
|
@@ -3,31 +3,21 @@ set(TSTFLAMEGRAPHVIEW_CPP_SOURCES
|
|||||||
tst_flamegraphview.cpp
|
tst_flamegraphview.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
add_qtc_test(tst_tracing_flamegraphview
|
||||||
add_qtc_test(tst_tracing_flamegraphview
|
EXCLUDE_FROM_PRECHECK
|
||||||
EXCLUDE_FROM_PRECHECK
|
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
|
||||||
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
|
)
|
||||||
SOURCES
|
|
||||||
${TSTFLAMEGRAPHVIEW_CPP_SOURCES}
|
|
||||||
flamegraphview.qrc
|
|
||||||
)
|
|
||||||
else() # < Qt 6.2
|
|
||||||
add_qtc_test(tst_tracing_flamegraphview
|
|
||||||
EXCLUDE_FROM_PRECHECK
|
|
||||||
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT TARGET tst_tracing_flamegraphview) # qt_add_qml_module has no DEPENDS check
|
if (NOT TARGET tst_tracing_flamegraphview) # qt_add_qml_module has no DEPENDS check
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_add_qml_module(tst_tracing_flamegraphview
|
qt_add_qml_module(tst_tracing_flamegraphview
|
||||||
URI "QtCreator.TstTracingFlameGraphView"
|
URI "QtCreator.TstTracingFlameGraphView"
|
||||||
VERSION "1.0"
|
VERSION "1.0"
|
||||||
NO_PLUGIN
|
NO_PLUGIN
|
||||||
QML_FILES
|
QML_FILES
|
||||||
TestFlameGraphView.qml
|
TestFlameGraphView.qml
|
||||||
SOURCES
|
SOURCES
|
||||||
${TSTFLAMEGRAPHVIEW_CPP_SOURCES}
|
${TSTFLAMEGRAPHVIEW_CPP_SOURCES}
|
||||||
)
|
)
|
||||||
endif() # < Qt 6.2
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtCreator.TstTracingFlameGraphView 1.0
|
import QtCreator.TstTracingFlameGraphView
|
||||||
import "../Tracing" // TODO: Turn into module import when possible
|
import "../Tracing" // TODO: Turn into module import when possible
|
||||||
|
|
||||||
FlameGraphView {
|
FlameGraphView {
|
||||||
|
@@ -11,7 +11,16 @@ TracingAutotest {
|
|||||||
name: "Test sources"
|
name: "Test sources"
|
||||||
files: [
|
files: [
|
||||||
"testflamegraphmodel.h",
|
"testflamegraphmodel.h",
|
||||||
"tst_flamegraphview.cpp", "flamegraphview.qrc"
|
"tst_flamegraphview.cpp"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
Group {
|
||||||
|
name: "Qml Files"
|
||||||
|
Qt.core.resourcePrefix: "QtCreator/TstTracingFlameGraphView/"
|
||||||
|
fileTags: "qt.core.resource_data"
|
||||||
|
files: [
|
||||||
|
"TestFlameGraphView.qml",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/QtCreator/TstTracingFlameGraphView">
|
|
||||||
<file>TestFlameGraphView.qml</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
@@ -31,10 +31,9 @@
|
|||||||
class TestFlameGraphModel : public QStandardItemModel
|
class TestFlameGraphModel : public QStandardItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
QML_UNCREATABLE("use the context property")
|
QML_UNCREATABLE("use the context property")
|
||||||
#endif // Qt >= 6.2
|
|
||||||
public:
|
public:
|
||||||
enum Role {
|
enum Role {
|
||||||
TypeIdRole = Qt::UserRole + 1,
|
TypeIdRole = Qt::UserRole + 1,
|
||||||
|
@@ -72,22 +72,13 @@ private:
|
|||||||
|
|
||||||
void tst_FlameGraphView::initMain()
|
void tst_FlameGraphView::initMain()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qputenv("QSG_RHI_BACKEND", "opengl");
|
qputenv("QSG_RHI_BACKEND", "opengl");
|
||||||
#endif // Qt >= 6.2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_FlameGraphView::initTestCase()
|
void tst_FlameGraphView::initTestCase()
|
||||||
{
|
{
|
||||||
model.fill();
|
model.fill();
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<FlameGraph::FlameGraph>("QtCreator.Tracing", 1, 0, "FlameGraph");
|
|
||||||
qmlRegisterUncreatableType<TestFlameGraphModel>(
|
|
||||||
"QtCreator.TstTracingFlameGraphView", 1, 0, "TestFlameGraphModel",
|
|
||||||
QLatin1String("use the context property"));
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
Timeline::TimelineTheme::setupTheme(widget.engine());
|
Timeline::TimelineTheme::setupTheme(widget.engine());
|
||||||
|
|
||||||
|
@@ -111,18 +111,10 @@ void tst_TimelineItemsRenderPass::update()
|
|||||||
QCOMPARE(node->geometry()->vertexCount(), 30);
|
QCOMPARE(node->geometry()->vertexCount(), 30);
|
||||||
QVERIFY(material2 != 0);
|
QVERIFY(material2 != 0);
|
||||||
QCOMPARE(material1->type(), material2->type());
|
QCOMPARE(material1->type(), material2->type());
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader();
|
|
||||||
QVERIFY(shader1 != 0);
|
|
||||||
QSGMaterialShader *shader2 = material2->createShader();
|
|
||||||
QVERIFY(shader2 != 0);
|
|
||||||
QCOMPARE(shader1->attributeNames(), shader2->attributeNames());
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader1 != 0);
|
QVERIFY(shader1 != 0);
|
||||||
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader2 != 0);
|
QVERIFY(shader2 != 0);
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
delete shader1;
|
delete shader1;
|
||||||
delete shader2;
|
delete shader2;
|
||||||
|
@@ -121,18 +121,10 @@ void tst_TimelineNotesRenderPass::update()
|
|||||||
QCOMPARE(node->geometry()->vertexCount(), 2);
|
QCOMPARE(node->geometry()->vertexCount(), 2);
|
||||||
QVERIFY(material2 != 0);
|
QVERIFY(material2 != 0);
|
||||||
QCOMPARE(material1->type(), material2->type());
|
QCOMPARE(material1->type(), material2->type());
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader();
|
|
||||||
QVERIFY(shader1 != 0);
|
|
||||||
QSGMaterialShader *shader2 = material2->createShader();
|
|
||||||
QVERIFY(shader2 != 0);
|
|
||||||
QCOMPARE(shader1->attributeNames(), shader2->attributeNames());
|
|
||||||
#else // < Qt 6
|
|
||||||
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader1 != 0);
|
QVERIFY(shader1 != 0);
|
||||||
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D);
|
||||||
QVERIFY(shader2 != 0);
|
QVERIFY(shader2 != 0);
|
||||||
#endif // < Qt 6
|
|
||||||
|
|
||||||
delete shader1;
|
delete shader1;
|
||||||
delete shader2;
|
delete shader2;
|
||||||
|
@@ -94,16 +94,6 @@ void tst_TimelineRenderer::testMouseEvents(DummyRenderer *renderer, int x, int y
|
|||||||
|
|
||||||
QHoverEvent hover(QMouseEvent::HoverMove, QPointF(x, y), QPointF(x - 1, y));
|
QHoverEvent hover(QMouseEvent::HoverMove, QPointF(x, y), QPointF(x - 1, y));
|
||||||
renderer->hoverMoveEvent(&hover);
|
renderer->hoverMoveEvent(&hover);
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
event = QMouseEvent(QMouseEvent::MouseButtonPress, QPointF(x, y), Qt::LeftButton,
|
|
||||||
Qt::LeftButton, Qt::NoModifier);
|
|
||||||
renderer->mousePressEvent(&event);
|
|
||||||
|
|
||||||
event = QMouseEvent(QMouseEvent::MouseButtonRelease, QPointF(x, y), Qt::LeftButton,
|
|
||||||
Qt::LeftButton, Qt::NoModifier);
|
|
||||||
renderer->mouseReleaseEvent(&event);
|
|
||||||
#endif // < Qt 6
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_TimelineRenderer::mouseEvents()
|
void tst_TimelineRenderer::mouseEvents()
|
||||||
|
@@ -125,17 +125,7 @@ public:
|
|||||||
{
|
{
|
||||||
setResizeMode(QQuickView::SizeRootObjectToView);
|
setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
|
||||||
qmlRegisterType<TimelineRenderer>("QtCreator.Tracing", 1, 0, "TimelineRenderer");
|
|
||||||
qmlRegisterType<TimelineOverviewRenderer>(
|
|
||||||
"QtCreator.Tracing", 1, 0, "TimelineOverviewRenderer");
|
|
||||||
qmlRegisterAnonymousType<TimelineZoomControl>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<TimelineModel>("QtCreator.Tracing", 1);
|
|
||||||
qmlRegisterAnonymousType<TimelineNotesModel>("QtCreator.Tracing", 1);
|
|
||||||
#endif // Qt < 6.2
|
|
||||||
|
|
||||||
TimelineTheme::setupTheme(engine());
|
TimelineTheme::setupTheme(engine());
|
||||||
TimeFormatter::setupTimeFormatter();
|
|
||||||
|
|
||||||
m_modelAggregator = new TimelineModelAggregator(this);
|
m_modelAggregator = new TimelineModelAggregator(this);
|
||||||
m_model = new DummyModel(m_modelAggregator);
|
m_model = new DummyModel(m_modelAggregator);
|
||||||
@@ -162,11 +152,6 @@ public:
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
||||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
||||||
#endif // Qt < 6
|
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
ManualTest::ThemeSelector::setTheme(":/themes/flat.creatortheme");
|
ManualTest::ThemeSelector::setTheme(":/themes/flat.creatortheme");
|
||||||
|
Reference in New Issue
Block a user