Merge remote-tracking branch 'origin/7.0'

Conflicts:
	src/plugins/android/androiddevice.h
	src/plugins/android/androidplugin.cpp
	src/plugins/android/androidplugin.h

Change-Id: I1a68354415283fe4a7450706520a576d2a1775e0
This commit is contained in:
Eike Ziller
2022-03-23 14:16:07 +01:00
37 changed files with 644 additions and 122 deletions

View File

@@ -89,7 +89,9 @@ endif()
# Crashpad
set(CRASHPAD_BACKEND_URL "" CACHE STRING "Crashpad backend URL")
set(BUILD_WITH_CRASHPAD OFF)
if(CRASHPAD_BACKEND_URL AND (WIN32 OR APPLE)) # Linux is not supported for now
# Linux is not supported for now
# x86_64;arm64 is not supported for now
if(CRASHPAD_BACKEND_URL AND (WIN32 OR (APPLE AND NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64;arm64")))
find_package(Crashpad QUIET)
if(TARGET Crashpad::Crashpad)
set(BUILD_WITH_CRASHPAD ON)

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.

View File

@@ -279,6 +279,11 @@
\li Always Show Camera Frustums
\li Toggles between always showing the camera frustum and showing it
only for cameras selected in \uicontrol {3D Editor}.
\row
\li Always Show Particle Emitters and Attractors
\li Toggle between always showing the particle emitter and attractor
visualizations and only showing them when the emitter or attractor is
selected in \uicontrol {3D Editor}.
\endtable
\section1 Particle Editor

View File

@@ -729,8 +729,9 @@
\l {Model Shape} component to use. The shape is scaled, positioned, and
rotated based on the emitter node properties. When the shape \uicontrol Fill
property is set to false, particles are emitted only from the surface of the
shape. When the shape is not defined, particles are emitted from the center
point of the emitter.
shape. When the shape is defined, it is visualized in
\uicontrol {3D Editor}. When the shape is not defined, particles are emitted
from the center point of the emitter.
In \uicontrol {Life span}, specify the lifespan of a single particle
in milliseconds. Specify variation in the particle lifespan in
@@ -883,7 +884,8 @@
In \uicontrol Shape, select an instance of the \l {Particle Shape} or
\l {Model Shape} component to attract particles into a random position
inside the shape.
inside the shape. When the shape is defined, it is visualized in
\uicontrol {3D Editor}.
\uicontrol Duration specifies the duration in milliseconds that it takes
for particles to reach the attraction position. When the value is -1,

View File

@@ -265,7 +265,7 @@ Item {
anchors.fill: parent
anchors.margins: DialogValues.gridMargins
NewProjectView {
PresetView {
id: presetView
anchors.fill: parent

View File

@@ -140,6 +140,7 @@ Item {
id: delegateId
width: stylesList.width
height: DialogValues.styleListItemHeight
hoverEnabled: true
onClicked: stylesList.currentIndex = index
@@ -161,13 +162,13 @@ Item {
height: DialogValues.styleImageHeight
+ 2 * DialogValues.styleImageBorderWidth
border.color: itemRectMouseArea.containsMouse
border.color: delegateId.hovered
? DialogValues.textColor
: (index === stylesList.currentIndex
? DialogValues.textColorInteraction
: "transparent")
border.width: index === stylesList.currentIndex || itemRectMouseArea.containsMouse
border.width: index === stylesList.currentIndex || delegateId.hovered
? DialogValues.styleImageBorderWidth
: 0
@@ -182,12 +183,6 @@ Item {
asynchronous: false
source: "image://newprojectdialog_library/" + BackendApi.styleModel.iconId(model.index)
}
MouseArea {
id: itemRectMouseArea
anchors.fill: parent
hoverEnabled: true
}
} // Rectangle
Text {

View File

@@ -3,5 +3,5 @@ PopupDialogButton 1.0 PopupDialogButton.qml
PopupDialogButtonBox 1.0 PopupDialogButtonBox.qml
Details 1.0 Details.qml
singleton DialogValues 1.0 DialogValues.qml
NewProjectView 1.0 NewProjectView.qml
PresetView 1.0 PresetView.qml
Styles 1.0 Styles.qml

View File

@@ -26,6 +26,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme
Section {
@@ -47,6 +48,40 @@ Section {
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Position") }
SecondColumnLayout {
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.x
maximumValue: 0xffff
minimumValue: -0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "X" }
Spacer { implicitWidth: StudioTheme.Values.controlGap }
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.y
maximumValue: 0xffff
minimumValue: -0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "Y" }
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Size") }
SecondColumnLayout {
@@ -87,6 +122,92 @@ Section {
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Minimum size")
tooltip: qsTr("Minimum size of the window.")
}
SecondColumnLayout {
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.minimumWidth
minimumValue: 0
maximumValue: 0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap }
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.minimumHeight
minimumValue: 0
maximumValue: 0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Maximum size")
tooltip: qsTr("Maximum size of the window.")
}
SecondColumnLayout {
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.maximumWidth
minimumValue: 0
maximumValue: 0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap }
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.maximumHeight
minimumValue: 0
maximumValue: 0xffff
decimals: 0
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Color") }
ColorEditor {
@@ -122,5 +243,316 @@ Section {
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Content orientation") }
SecondColumnLayout {
StudioControls.ComboBox {
id: contentOrientationComboBox
property bool __isCompleted: false
property variant backendValue: backendValues.contentOrientation
property variant valueFromBackend: contentOrientationComboBox.backendValue?.value ?? 0
property bool isInModel: contentOrientationComboBox.backendValue?.isInModel ?? false
property bool isInSubState: contentOrientationComboBox.backendValue?.isInSubState ?? false
property bool block: false
onIsInModelChanged: contentOrientationComboBox.evaluateValue()
onIsInSubStateChanged: contentOrientationComboBox.evaluateValue()
onBackendValueChanged: contentOrientationComboBox.evaluateValue()
onValueFromBackendChanged: contentOrientationComboBox.evaluateValue()
Connections {
target: modelNodeBackend
function onSelectionChanged() { contentOrientationComboBox.evaluateValue() }
}
function indexOfContentOrientation() {
if (contentOrientationComboBox.backendValue === undefined
|| contentOrientationComboBox.backendValue.expression === undefined)
return 0
let value = contentOrientationComboBox.backendValue.expression
if (value.indexOf("PrimaryOrientation") !== -1) return 0
if (value.indexOf("LandscapeOrientation") !== -1) return 1
if (value.indexOf("PortraitOrientation") !== -1) return 2
if (value.indexOf("InvertedLandscapeOrientation") !== -1) return 3
if (value.indexOf("InvertedPortraitOrientation") !== -1) return 4
return 0
}
function evaluateValue() {
contentOrientationComboBox.block = true
contentOrientationComboBox.currentIndex = indexOfContentOrientation()
contentOrientationComboBox.block = false
}
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
width: implicitWidth
labelColor: contentOrientationComboBox.currentIndex === 0
? contentOrientationColorLogic.__defaultTextColor
: contentOrientationColorLogic.__changedTextColor
model: ["PrimaryOrientation", "LandscapeOrientation", "PortraitOrientation",
"InvertedLandscapeOrientation", "InvertedPortraitOrientation"]
ColorLogic { id: contentOrientationColorLogic }
actionIndicator.icon.color: contentOrientationExtFuncLogic.color
actionIndicator.icon.text: contentOrientationExtFuncLogic.glyph
actionIndicator.onClicked: contentOrientationExtFuncLogic.show()
actionIndicator.forceVisible: contentOrientationExtFuncLogic.menuVisible
actionIndicator.visible: true
ExtendedFunctionLogic {
id: contentOrientationExtFuncLogic
backendValue: backendValues.contentOrientation
onReseted: contentOrientationComboBox.currentIndex = 0
}
onActivated: function(index) {
if (!contentOrientationComboBox.__isCompleted)
return
contentOrientationComboBox.currentIndex = index
contentOrientationComboBox.composeExpressionString()
}
function composeExpressionString() {
if (contentOrientationComboBox.block)
return
var expressionStr = ""
if (contentOrientationComboBox.currentIndex !== 0) {
expressionStr = "Qt." + contentOrientationComboBox.currentText
contentOrientationComboBox.backendValue.expression = expressionStr
}
}
Component.onCompleted: {
contentOrientationComboBox.evaluateValue()
contentOrientationComboBox.__isCompleted = true
}
}
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Flags") }
SecondColumnLayout {
StudioControls.ComboBox {
id: flagsComboBox
property bool __isCompleted: false
property variant backendValue: backendValues.flags
property variant valueFromBackend: flagsComboBox.backendValue?.value ?? 0
property bool isInModel: flagsComboBox.backendValue?.isInModel ?? false
property bool isInSubState: flagsComboBox.backendValue?.isInSubState ?? false
property bool block: false
onIsInModelChanged: flagsComboBox.evaluateValue()
onIsInSubStateChanged: flagsComboBox.evaluateValue()
onBackendValueChanged: flagsComboBox.evaluateValue()
onValueFromBackendChanged: flagsComboBox.evaluateValue()
Connections {
target: modelNodeBackend
function onSelectionChanged() { flagsComboBox.evaluateValue() }
}
function indexOfFlags() {
if (flagsComboBox.backendValue === undefined
|| flagsComboBox.backendValue.expression === undefined)
return 0
let value = flagsComboBox.backendValue.expression
if (value.indexOf("Widget") !== -1) return 0
if (value.indexOf("Window") !== -1) return 1
if (value.indexOf("Dialog") !== -1) return 2
if (value.indexOf("Sheet") !== -1) return 3
if (value.indexOf("Drawer") !== -1) return 4
if (value.indexOf("Popup") !== -1) return 5
if (value.indexOf("Tool") !== -1) return 6
if (value.indexOf("ToolTip") !== -1) return 7
if (value.indexOf("SplashScreen") !== -1) return 8
if (value.indexOf("Desktop") !== -1) return 9
if (value.indexOf("SubWindow") !== -1) return 10
if (value.indexOf("ForeignWindow") !== -1) return 11
if (value.indexOf("CoverWindow") !== -1) return 12
return 0
}
function evaluateValue() {
flagsComboBox.block = true
flagsComboBox.currentIndex = indexOfFlags()
flagsComboBox.block = false
}
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
width: implicitWidth
labelColor: flagsComboBox.currentIndex === 0 ? flagsColorLogic.__defaultTextColor
: flagsColorLogic.__changedTextColor
model: ["Widget", "Window", "Dialog", "Sheet", "Drawer", "Popup", "Tool", "ToolTip",
"SplashScreen", "Desktop", "SubWindow", "ForeignWindow", "CoverWindow"]
ColorLogic { id: flagsColorLogic }
actionIndicator.icon.color: flagsExtFuncLogic.color
actionIndicator.icon.text: flagsExtFuncLogic.glyph
actionIndicator.onClicked: flagsExtFuncLogic.show()
actionIndicator.forceVisible: flagsExtFuncLogic.menuVisible
actionIndicator.visible: true
ExtendedFunctionLogic {
id: flagsExtFuncLogic
backendValue: backendValues.flags
onReseted: flagsComboBox.currentIndex = 0
}
onActivated: function(index) {
if (!flagsComboBox.__isCompleted)
return
flagsComboBox.currentIndex = index
flagsComboBox.composeExpressionString()
}
function composeExpressionString() {
if (flagsComboBox.block)
return
var expressionStr = ""
if (flagsComboBox.currentIndex !== 0) {
expressionStr = "Qt." + flagsComboBox.currentText
flagsComboBox.backendValue.expression = expressionStr
}
}
Component.onCompleted: {
flagsComboBox.evaluateValue()
flagsComboBox.__isCompleted = true
}
}
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Modality") }
SecondColumnLayout {
StudioControls.ComboBox {
id: modalityComboBox
property bool __isCompleted: false
property variant backendValue: backendValues.modality
property variant valueFromBackend: modalityComboBox.backendValue?.value ?? 0
property bool isInModel: modalityComboBox.backendValue?.isInModel ?? false
property bool isInSubState: modalityComboBox.backendValue?.isInSubState ?? false
property bool block: false
onIsInModelChanged: modalityComboBox.evaluateValue()
onIsInSubStateChanged: modalityComboBox.evaluateValue()
onBackendValueChanged: modalityComboBox.evaluateValue()
onValueFromBackendChanged: modalityComboBox.evaluateValue()
Connections {
target: modelNodeBackend
function onSelectionChanged() { modalityComboBox.evaluateValue() }
}
function indexOfModality() {
if (modalityComboBox.backendValue === undefined
|| modalityComboBox.backendValue.expression === undefined)
return 0
let value = modalityComboBox.backendValue.expression
if (value.indexOf("NonModal") !== -1) return 0
if (value.indexOf("WindowModal") !== -1) return 1
if (value.indexOf("ApplicationModal") !== -1) return 2
return 0
}
function evaluateValue() {
modalityComboBox.block = true
modalityComboBox.currentIndex = indexOfModality()
modalityComboBox.block = false
}
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
width: implicitWidth
labelColor: modalityComboBox.currentIndex === 0
? modalityColorLogic.__defaultTextColor
: modalityColorLogic.__changedTextColor
model: ["NonModal", "WindowModal", "ApplicationModal"]
ColorLogic { id: modalityColorLogic }
actionIndicator.icon.color: modalityExtFuncLogic.color
actionIndicator.icon.text: modalityExtFuncLogic.glyph
actionIndicator.onClicked: modalityExtFuncLogic.show()
actionIndicator.forceVisible: modalityExtFuncLogic.menuVisible
actionIndicator.visible: true
ExtendedFunctionLogic {
id: modalityExtFuncLogic
backendValue: backendValues.modality
onReseted: modalityComboBox.currentIndex = 0
}
onActivated: function(index) {
if (!modalityComboBox.__isCompleted)
return
modalityComboBox.currentIndex = index
modalityComboBox.composeExpressionString()
}
function composeExpressionString() {
if (modalityComboBox.block)
return
var expressionStr = ""
if (modalityComboBox.currentIndex !== 0) {
expressionStr = "Qt." + modalityComboBox.currentText
modalityComboBox.backendValue.expression = expressionStr
}
}
Component.onCompleted: {
modalityComboBox.evaluateValue()
modalityComboBox.__isCompleted = true
}
}
ExpandingSpacer {}
}
PropertyLabel { text: qsTr("Visibility") }
SecondColumnLayout {
ComboBox {
scope: "Window"
model: ["AutomaticVisibility", "Windowed", "Minimized", "Maximized", "FullScreen",
"Hidden"]
backendValue: backendValues.visibility
enabled: backendValues.visibility.isAvailable
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}

View File

@@ -0,0 +1,29 @@
/****************************************************************************
**
** Copyright (C) 2022 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.
**
****************************************************************************/
import QtQuick 2.15
import "Window" as Original
Original.WindowSpecifics {}

View File

@@ -54,6 +54,7 @@ T.TextField {
color: StudioTheme.Values.themeTextColor
selectionColor: StudioTheme.Values.themeTextSelectionColor
selectedTextColor: StudioTheme.Values.themeTextSelectedTextColor
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
readOnly: false
selectByMouse: true
@@ -107,6 +108,23 @@ T.TextField {
height: actionIndicator.visible ? myTextField.__actionIndicatorHeight : 0
}
Text {
id: placeholder
x: myTextField.leftPadding
y: myTextField.topPadding
width: myTextField.width - (myTextField.leftPadding + myTextField.rightPadding)
height: myTextField.height - (myTextField.topPadding + myTextField.bottomPadding)
text: myTextField.placeholderText
font: myTextField.font
color: myTextField.placeholderTextColor
verticalAlignment: myTextField.verticalAlignment
visible: !myTextField.length && !myTextField.preeditText
&& (!myTextField.activeFocus || myTextField.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
renderType: myTextField.renderType
}
background: Rectangle {
id: textFieldBackground
color: StudioTheme.Values.themeControlBackground
@@ -138,6 +156,7 @@ T.TextField {
PropertyChanges {
target: myTextField
color: StudioTheme.Values.themeTextColor
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
}
PropertyChanges {
target: mouseArea
@@ -156,6 +175,7 @@ T.TextField {
PropertyChanges {
target: myTextField
color: StudioTheme.Values.themeTextColor
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
}
},
State {
@@ -170,6 +190,7 @@ T.TextField {
PropertyChanges {
target: myTextField
color: StudioTheme.Values.themeTextColor
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
}
},
State {
@@ -183,6 +204,7 @@ T.TextField {
PropertyChanges {
target: myTextField
color: StudioTheme.Values.themeTextColor
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColorInteraction
}
PropertyChanges {
target: mouseArea
@@ -200,6 +222,7 @@ T.TextField {
PropertyChanges {
target: myTextField
color: StudioTheme.Values.themeTextColorDisabled
placeholderTextColor: StudioTheme.Values.themeTextColorDisabled
}
}
]

View File

@@ -33,6 +33,7 @@ SliderPopup 1.0 SliderPopup.qml
SpinBox 1.0 SpinBox.qml
SpinBoxIndicator 1.0 SpinBoxIndicator.qml
SpinBoxInput 1.0 SpinBoxInput.qml
Switch 1.0 Switch.qml
TabBar 1.0 TabBar.qml
TabButton 1.0 TabButton.qml
TextArea 1.0 TextArea.qml

View File

@@ -33,7 +33,7 @@ import Qt.labs.folderlistmodel %{QtQuickVersion}
QtObject {
id: loader
property url fontDirectory: Qt.resolvedUrl("../../" + relativeFontDirectory)
property url fontDirectory: Qt.resolvedUrl("../../content/" + relativeFontDirectory)
property string relativeFontDirectory: "fonts"
function loadFont(url) {

View File

@@ -140,8 +140,9 @@ void LauncherInterfacePrivate::doStop()
m_server->close();
QTC_ASSERT(m_process, return);
m_socket->shutdown();
m_process->waitForFinished(3000);
ProcessReaper::reap(m_process);
m_process->waitForFinished(-1); // Let the process interface finish so that it finishes
// reaping any possible processes it has started.
delete m_process;
m_process = nullptr;
}

View File

@@ -195,6 +195,7 @@ void ProcessReaper::reap(QProcess *process, int timeoutMs)
return;
}
ProcessReaper::instance();
new Internal::Reaper(process, timeoutMs);
}

View File

@@ -88,20 +88,17 @@ static bool isTimedOut(const chrono::high_resolution_clock::time_point &start,
return timedOut;
}
static qint64 extractPID(const QByteArray &output, const QString &packageName)
static qint64 extractPID(const QString &output, const QString &packageName)
{
qint64 pid = -1;
foreach (auto tuple, output.split('\n')) {
tuple = tuple.simplified();
if (!tuple.isEmpty()) {
auto parts = tuple.split(':');
QString commandName = QString::fromLocal8Bit(parts.first());
if (parts.length() == 2 && commandName == packageName) {
for (const QString &tuple : output.split('\n')) {
// Make sure to remove null characters which might be present in the provided output
const QStringList parts = tuple.simplified().remove('\0').split(':');
if (parts.length() == 2 && parts.first() == packageName) {
pid = parts.last().toLongLong();
break;
}
}
}
return pid;
}
@@ -126,7 +123,7 @@ static void findProcessPID(QFutureInterface<qint64> &fi, QStringList selector,
QtcProcess proc;
proc.setCommand({adbPath, args});
proc.runBlocking();
const QByteArray out = proc.allRawOutput();
const QString out = proc.allOutput();
if (preNougat) {
processPID = extractPID(out, packageName);
} else {

View File

@@ -1018,9 +1018,12 @@ public:
m_started = true;
m_finalized = false;
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting";
// Used by ThreadedSubtaskTimer to mark the end of the whole highlighting operation
m_startTimer.restart();
}
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask started at "
<< QDateTime::currentDateTime().toString();
<< QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz");
QTC_CHECK(!m_timer.isValid());
m_timer.start();
}
@@ -1033,7 +1036,7 @@ public:
if (--m_subtasks > 0) // See startSubtask().
return;
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask stopped at "
<< QDateTime::currentDateTime().toString();
<< QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz");
QTC_CHECK(m_timer.isValid());
m_elapsedMs += m_timer.elapsed();
m_timer.invalidate();
@@ -1041,9 +1044,12 @@ public:
stopTask();
}
QElapsedTimer startTimer() const { return m_startTimer; }
private:
const QString m_task;
QElapsedTimer m_timer;
QElapsedTimer m_startTimer;
qint64 m_elapsedMs = 0;
int m_subtasks = 0;
bool m_started = false;
@@ -1073,7 +1079,7 @@ public:
class ThreadedSubtaskTimer
{
public:
ThreadedSubtaskTimer(const QString &task) : m_task(task)
ThreadedSubtaskTimer(const QString &task, const TaskTimer &taskTimer) : m_task(task), m_taskTimer(taskTimer)
{
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting thread";
m_timer.start();
@@ -1083,10 +1089,15 @@ public:
{
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": took " << m_timer.elapsed()
<< " ms in dedicated thread";
qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": Start to end: "
<< m_taskTimer.startTimer().elapsed() << " ms";
}
private:
const QString m_task;
QElapsedTimer m_timer;
const TaskTimer &m_taskTimer;
};
class MemoryTreeModel;
@@ -1212,6 +1223,13 @@ public:
: LanguageClientCompletionAssistProcessor(client, snippetsGroup)
, m_client(client)
{
m_timer.start();
}
~ClangdCompletionAssistProcessor()
{
qCDebug(clangdLogTiming).noquote().nospace()
<< "ClangdCompletionAssistProcessor took: " << m_timer.elapsed() << " ms";
}
private:
@@ -1229,6 +1247,7 @@ private:
const QList<LanguageServerProtocol::CompletionItem> &items) const override;
ClangdClient * const m_client;
QElapsedTimer m_timer;
};
QList<AssistProposalItemInterface *>
@@ -2757,9 +2776,10 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
const QList<ExpandedSemanticToken> &tokens,
const QString &docContents, const AstNode &ast,
const QPointer<TextDocument> &textDocument,
int docRevision, const QVersionNumber &clangdVersion)
int docRevision, const QVersionNumber &clangdVersion,
const TaskTimer &taskTimer)
{
ThreadedSubtaskTimer t("highlighting");
ThreadedSubtaskTimer t("highlighting", taskTimer);
if (future.isCanceled()) {
future.reportFinished();
return;
@@ -3025,9 +3045,10 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc,
const auto runner = [tokens, filePath = doc->filePath(),
text = doc->document()->toPlainText(), ast,
doc = QPointer(doc), rev = doc->document()->revision(),
clangdVersion = q->versionNumber()] {
clangdVersion = q->versionNumber(),
this] {
return Utils::runAsync(semanticHighlighter, filePath, tokens, text, ast, doc, rev,
clangdVersion);
clangdVersion, highlightingTimer);
};
if (isTesting) {

View File

@@ -2394,8 +2394,9 @@ void EditorManagerPrivate::handleContextChange(const QList<IContext *> &context)
// the locator line edit) first activates the window and sets focus to its focus widget.
// Only afterwards the focus is shifted to the widget that received the click.
d->m_scheduledCurrentEditor = editor;
QMetaObject::invokeMethod(d, &EditorManagerPrivate::setCurrentEditorFromContextChange,
Qt::QueuedConnection);
QTimer::singleShot(QApplication::doubleClickInterval() + 10,
d,
&EditorManagerPrivate::setCurrentEditorFromContextChange);
} else {
updateActions();
}

View File

@@ -141,8 +141,10 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl)
{
if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration())
if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration();
templDecl && templDecl->declaration) {
decl = templDecl->declaration;
}
SpecifierAST *spec = nullptr;
DeclaratorAST *decltr = nullptr;

View File

@@ -416,15 +416,6 @@ QQmlComponent *PropertyEditorContextObject::specificQmlComponent()
return m_qmlComponent;
}
void PropertyEditorContextObject::setGlobalBaseUrl(const QUrl &newBaseUrl)
{
if (newBaseUrl == m_globalBaseUrl)
return;
m_globalBaseUrl = newBaseUrl;
emit globalBaseUrlChanged();
}
void PropertyEditorContextObject::setSpecificsUrl(const QUrl &newSpecificsUrl)
{
if (newSpecificsUrl == m_specificsUrl)

View File

@@ -42,7 +42,6 @@ class PropertyEditorContextObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QUrl globalBaseUrl READ globalBaseUrl WRITE setGlobalBaseUrl NOTIFY globalBaseUrlChanged)
Q_PROPERTY(QUrl specificsUrl READ specificsUrl WRITE setSpecificsUrl NOTIFY specificsUrlChanged)
Q_PROPERTY(QString specificQmlData READ specificQmlData WRITE setSpecificQmlData NOTIFY specificQmlDataChanged)
@@ -68,7 +67,6 @@ class PropertyEditorContextObject : public QObject
public:
PropertyEditorContextObject(QObject *parent = nullptr);
QUrl globalBaseUrl() const {return m_globalBaseUrl; }
QUrl specificsUrl() const {return m_specificsUrl; }
QString specificQmlData() const {return m_specificQmlData; }
QString stateName() const {return m_stateName; }
@@ -122,7 +120,6 @@ public:
bool hasAliasExport() const { return m_aliasExport; }
signals:
void globalBaseUrlChanged();
void specificsUrlChanged();
void specificQmlDataChanged();
void stateNameChanged();
@@ -139,7 +136,6 @@ signals:
void hasActiveTimelineChanged();
public slots:
void setGlobalBaseUrl(const QUrl &newBaseUrl);
void setSpecificsUrl(const QUrl &newSpecificsUrl);
@@ -161,7 +157,6 @@ public slots:
void setHasAliasExport(bool hasAliasExport);
private:
QUrl m_globalBaseUrl;
QUrl m_specificsUrl;
QString m_specificQmlData;

View File

@@ -549,8 +549,6 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl
contextObject()->setIsBaseState(true);
contextObject()->setSpecificQmlData(QStringLiteral(""));
contextObject()->setGlobalBaseUrl(QUrl());
}
QString PropertyEditorQmlBackend::propertyEditorResourcesPath()

View File

@@ -119,18 +119,13 @@ void PropertyEditorView::setupPane(const TypeName &typeName)
if (!qmlBackend) {
qmlBackend = new PropertyEditorQmlBackend(this);
qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) );
qmlBackend->initialSetup(typeName, qmlSpecificsFile, this);
qmlBackend->setSource(qmlFile);
qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) );
m_stackedWidget->addWidget(qmlBackend->widget());
m_qmlBackendHash.insert(qmlFile.toString(), qmlBackend);
} else {
qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) );
qmlBackend->initialSetup(typeName, qmlSpecificsFile, this);
qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) );
}
}
@@ -499,14 +494,12 @@ void PropertyEditorView::setupQmlBackend()
} else {
qmlObjectNode.reset(new QmlObjectNode);
}
currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false));
if (specificQmlData.isEmpty())
currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData);
currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile);
currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData);
currentQmlBackend->setSource(qmlFile);
currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true));
} else {
QScopedPointer<QmlObjectNode> qmlObjectNode;
if (m_selectedNode.isValid())
@@ -514,18 +507,14 @@ void PropertyEditorView::setupQmlBackend()
else
qmlObjectNode.reset(new QmlObjectNode);
currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false));
if (specificQmlData.isEmpty())
currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData);
currentQmlBackend->setup(*qmlObjectNode, currentStateName, qmlSpecificsFile, this);
currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile);
currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData);
}
m_stackedWidget->setCurrentWidget(currentQmlBackend->widget());
currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true));
currentQmlBackend->contextObject()->triggerSelectionChanged();
m_qmlBackEndForCurrentType = currentQmlBackend;

View File

@@ -91,31 +91,4 @@ void Quick2PropertyEditorView::registerQmlTypes()
}
}
bool Quick2PropertyEditorView::event(QEvent *e)
{
static std::vector<QKeySequence> overrideSequences = { QKeySequence(Qt::SHIFT + Qt::Key_Up),
QKeySequence(Qt::SHIFT + Qt::Key_Down),
QKeySequence(Qt::CTRL + Qt::Key_Up),
QKeySequence(Qt::CTRL + Qt::Key_Down)
};
if (e->type() == QEvent::ShortcutOverride) {
auto keyEvent = static_cast<QKeyEvent *>(e);
static const Qt::KeyboardModifiers relevantModifiers = Qt::ShiftModifier
| Qt::ControlModifier
| Qt::AltModifier
| Qt::MetaModifier;
QKeySequence keySqeuence(keyEvent->key() | (keyEvent->modifiers() & relevantModifiers));
for (const QKeySequence &overrideSequence : overrideSequences)
if (keySqeuence.matches(overrideSequence)) {
keyEvent->accept();
return true;
}
}
return QQuickWidget::event(e);
}
} //QmlDesigner

View File

@@ -38,9 +38,6 @@ public:
explicit Quick2PropertyEditorView(QWidget *parent = nullptr);
static void registerQmlTypes();
protected:
bool event(QEvent *e) override;
};
} //QmlDesigner

View File

@@ -30,10 +30,16 @@
#include "iwidgetplugin.h"
#include <coreplugin/messagebox.h>
#include <coreplugin/icore.h>
#include <utils/filepath.h>
#include "pluginmanager/widgetpluginmanager.h"
#include <QDebug>
#include <QMessageBox>
#include <QDir>
#include <QDirIterator>
#include <QMutex>
enum {
@@ -43,6 +49,30 @@ enum {
namespace QmlDesigner {
namespace Internal {
static QString globalMetaInfoPath()
{
#ifdef SHARE_QML_PATH
if (qEnvironmentVariableIsSet("LOAD_QML_FROM_SOURCE"))
return QLatin1String(SHARE_QML_PATH) + "/globalMetaInfo";
#endif
return Core::ICore::resourcePath("qmldesigner/globalMetaInfo").toString();
}
Utils::FilePaths allGlobalMetaInfoFiles()
{
static Utils::FilePaths paths;
if (!paths.isEmpty())
return paths;
QDirIterator it(globalMetaInfoPath(), { "*.metainfo" }, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext())
paths.append(Utils::FilePath::fromString(it.next()));
return paths;
}
class MetaInfoPrivate
{
Q_DISABLE_COPY(MetaInfoPrivate)
@@ -99,6 +129,19 @@ void MetaInfoPrivate::parseItemLibraryDescriptions()
errorMessage);
}
}
const Utils::FilePaths allMetaInfoFiles = allGlobalMetaInfoFiles();
for (const Utils::FilePath &path : allMetaInfoFiles) {
Internal::MetaInfoReader reader(*m_q);
try {
reader.readMetaInfoFile(path.toString());
} catch (const InvalidMetaInfoException &e) {
qWarning() << e.description();
const QString errorMessage = path.toString() + QLatin1Char('\n') + QLatin1Char('\n') + reader.errors().join(QLatin1Char('\n'));
Core::AsynchronousMessageBox::warning(QCoreApplication::translate("QmlDesigner::Internal::MetaInfoPrivate", "Invalid meta info"),
errorMessage);
}
}
#endif
}

View File

@@ -196,7 +196,8 @@ static bool isIdToAvoid(const QString& id)
"texture",
"shaderInfo",
"sprite",
"spriteSequence"
"spriteSequence",
"baseState"
};
return ids.contains(id);

View File

@@ -335,7 +335,7 @@ QmlObjectNode QmlVisualNode::createQmlObjectNode(AbstractView *view,
if (!newQmlObjectNode.isValid())
return;
newQmlObjectNode.setId(view->model()->generateNewId(itemLibraryEntry.name()));
newQmlObjectNode.modelNode().setIdWithoutRefactoring(view->model()->generateNewId(itemLibraryEntry.name()));
for (const auto &propertyBindingEntry : propertyBindingList)
newQmlObjectNode.modelNode().bindingProperty(propertyBindingEntry.first).setExpression(propertyBindingEntry.second);

View File

@@ -958,6 +958,12 @@ static QList<QmlDesigner::Import> generatePossibleLibraryImports(const QHash<QSt
int majorVersion = importKey.majorVersion;
if (majorVersion >= 0) {
int minorVersion = (importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion;
if (libraryName.contains("QtQuick.Studio")) {
majorVersion = 1;
minorVersion = 0;
}
QString version = QStringLiteral("%1.%2").arg(majorVersion).arg(minorVersion);
if (!libraryName.endsWith(".impl"))
possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version));

View File

@@ -26,7 +26,14 @@ MetaInfo {
"QtQuick.Controls.Imagine",
"QtQuick.Controls.Universal",
"QtQuick.Controls.Material",
"QtQuick.Controls.NativeStyle"
"QtQuick.Controls.NativeStyle",
"QtQuick.NativeStyle",
"QtRemoteObjects",
"Qt5Compat.GraphicalEffects",
"QtQuick.Templates",
"QtQuick.Shapes",
"QtQuick.Studio.EventSystem",
"QtQuick.Studio.EventSimulator"
]
showTagsForImports: [

View File

@@ -99,6 +99,8 @@ QdsNewDialog::QdsNewDialog(QWidget *parent)
QObject::connect(&m_wizard, &WizardHandler::statusMessageChanged, this, &QdsNewDialog::onStatusMessageChanged);
QObject::connect(&m_wizard, &WizardHandler::projectCanBeCreated, this, &QdsNewDialog::onProjectCanBeCreatedChanged);
m_dialog->installEventFilter(this);
QObject::connect(&m_wizard, &WizardHandler::wizardCreationFailed, this, [this]() {
QMessageBox::critical(m_dialog, tr("New project"), tr("Failed to initialize data"));
reject();
@@ -110,6 +112,17 @@ QdsNewDialog::QdsNewDialog(QWidget *parent)
});
}
bool QdsNewDialog::eventFilter(QObject *obj, QEvent *event)
{
if (obj == m_dialog && event->type() == QEvent::KeyPress
&& static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) {
reject();
return true;
}
return false;
}
void QdsNewDialog::onDeletingWizard()
{
m_screenSizeModel->setBackendModel(nullptr);

View File

@@ -42,6 +42,7 @@ class QStandardItemModel;
QT_END_NAMESPACE
namespace StudioWelcome {
class QdsNewDialog : public QObject, public Core::NewDialog
{
Q_OBJECT
@@ -151,6 +152,7 @@ private:
QString projectDescription() const { return m_qmlProjectDescription; }
void updateScreenSizes();
bool eventFilter(QObject *obj, QEvent *ev) override;
private slots:
void onDeletingWizard();

View File

@@ -256,7 +256,7 @@ extend_qtc_executable(qml2puppet
qmlprivategate_56.cpp qmlprivategate.h
)
if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY)
if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY AND Qt6_VERSION VERSION_GREATER_EQUAL 6.2.1)
add_subdirectory(${MULTILANGUAGE_SUPPORT_SUBDIRECTORY} multilanguagesupport_static_build)
endif()

View File

@@ -46,10 +46,10 @@ def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False):
"unnamed='1'}")
return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton)
def getWelcomeScreenMainButton(buttonLabel):
stackedWidget = waitForObject(":Qt Creator.WelcomeScreenStackedWidget")
currentStackWidget = stackedWidget.currentWidget()
return __getWelcomeScreenButtonHelper__(buttonLabel, currentStackWidget)
def getWelcomeScreenBottomButton(buttonLabel):
bottomArea = waitForObject("{type='Welcome::Internal::BottomArea' unnamed='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
return __getWelcomeScreenButtonHelper__(buttonLabel, bottomArea, False)
def getWelcomeTreeView(treeViewLabel):
try:

View File

@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Copyright (C) 2022 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
@@ -78,10 +78,8 @@ def main():
continue
if not startCreatorVerifyingClang(useClang):
continue
targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT
if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
projectName = createNewNonQtProject(tempDir(), "project-csup03", [targetToChoose])
projectName = createNewNonQtProject(tempDir(), "project-csup03",
[Targets.DESKTOP_5_14_1_DEFAULT])
checkCodeModelSettings(useClang)
openDocument("%s.Sources.main\\.cpp" % projectName)
editor = getEditorForFileSuffix("main.cpp")

View File

@@ -25,7 +25,7 @@
source("../../shared/qtcreator.py")
getStarted = 'Get Started Now'
getStarted = 'Get Started'
def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
global getStarted
@@ -41,7 +41,7 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
"Verifying: '%s' button is being displayed." % getStarted)
def buttonActive(button):
# colors of the default theme for active button on Welcome page
(activeRed, activeGreen, activeBlue) = (64, 65, 66)
(activeRed, activeGreen, activeBlue) = (69, 206, 85)
# QPalette::Window (used background color of Welcome page buttons)
enumQPaletteWindow = 10
color = button.palette.color(enumQPaletteWindow)
@@ -92,8 +92,8 @@ def main():
# select Projects and roughly check this
switchToSubMode('Projects')
for button in ['New', 'Open']:
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button)
for button in ['Create Project...', 'Open Project...']:
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button)
if test.verify(all((wsButtonFrame, wsButtonLabel)),
"Verified whether '%s' button is shown." % button):
test.verify(not buttonActive(wsButtonFrame),
@@ -111,7 +111,7 @@ def main():
'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html'
}
for text, url in textUrls.items():
button, label = getWelcomeScreenSideBarButton(text, True)
button, label = getWelcomeScreenBottomButton(text)
if test.verify(all((button, label)),
"Verifying whether link button (%s) exists." % text):
test.compare(str(button.toolTip), url, "Verifying URL for %s" % text)
@@ -135,7 +135,7 @@ def main():
switchToSubMode('Examples')
test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.")
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
"examples list"),
("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"),
("QComboBox", "currentText~='.*Qt.*'", "Qt version combo box"))
@@ -149,7 +149,7 @@ def main():
# select Tutorials and roughly check them
switchToSubMode('Tutorials')
test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.")
expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'",
"tutorials list"),
("QLineEdit", "placeholderText='Search in Tutorials...'",
"tutorials search line edit"))

View File

@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Copyright (C) 2022 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
@@ -36,10 +36,7 @@ def main():
return
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT
if not qt4Available:
targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT
openQmakeProject(pathSpeedcrunch, [targetToChoose])
openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_5_14_1_DEFAULT])
# Wait for parsing to complete
waitFor("runButton.enabled", 30000)
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)