Merge remote-tracking branch 'origin/5.0'

Change-Id: I370268624bd6e91e7b44fa236e913f5f55867e17
This commit is contained in:
Eike Ziller
2021-08-20 09:50:30 +02:00
28 changed files with 174 additions and 154 deletions

View File

@@ -26,7 +26,9 @@ function(qtc_enable_separate_debug_info target installDestination)
unset(commands)
if(APPLE)
find_program(DSYMUTIL_PROGRAM dsymutil)
find_program(DSYMUTIL_PROGRAM dsymutil
NO_PACKAGE_ROOT_PATH
NO_CMAKE_PATH)
set(copy_bin ${DSYMUTIL_PROGRAM})
set(strip_bin ${CMAKE_STRIP})
set(debug_info_suffix dSYM)

View File

@@ -7,7 +7,7 @@ instructions:
variableValue: "RelWithDebInfo"
- type: EnvironmentVariable
variableName: QTC_QT_BASE_URL
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.2/6.2.0-beta2-released/"
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.2/6.2.0-beta3-released/"
- type: EnvironmentVariable
variableName: QTC_QT_MODULES
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations"

View File

@@ -814,10 +814,6 @@ void Qt5InformationNodeInstanceServer::doRender3DEditView()
m_editView3DData.window->afterRendering();
}
#else
if (m_render2D) {
// Render 2D content, as it might be used by 3D content
m_render2D = !renderWindow();
}
renderImage = grabRenderControl(m_editView3DData);
#endif
@@ -1822,11 +1818,6 @@ void Qt5InformationNodeInstanceServer::changePropertyValues(const ChangeValuesCo
if (!container.isReflected()) {
hasDynamicProperties |= container.isDynamic();
setInstancePropertyVariant(container);
if (!m_render2D && isQuick3DMode() && hasInstanceForId(container.instanceId())) {
ServerNodeInstance instance = instanceForId(container.instanceId());
if (instance.isSubclassOf("QQuickItem"))
m_render2D = true;
}
}
}
@@ -1937,17 +1928,6 @@ void Qt5InformationNodeInstanceServer::changeAuxiliaryValues(const ChangeAuxilia
void Qt5InformationNodeInstanceServer::changePropertyBindings(const ChangeBindingsCommand &command)
{
Qt5NodeInstanceServer::changePropertyBindings(command);
const QVector<PropertyBindingContainer> &values = command.bindingChanges;
for (const PropertyBindingContainer &container : values) {
if (!m_render2D && isQuick3DMode() && hasInstanceForId(container.instanceId())) {
ServerNodeInstance instance = instanceForId(container.instanceId());
if (instance.isSubclassOf("QQuickItem")) {
m_render2D = true;
break;
}
}
}
render3DEditView();
}

View File

@@ -165,7 +165,6 @@ private:
QList<InputEventCommand> m_pendingInputEventCommands;
QObject *m_3dHelper = nullptr;
int m_need3DEditViewRender = 0;
bool m_render2D = true;
};
} // namespace QmlDesigner

View File

@@ -219,6 +219,13 @@ QString static getErrorString(QQmlEngine *engine, const QString &componentPath)
return s;
}
bool isInPathList(const QStringList &pathList, const QString &componentPath)
{
return std::any_of(pathList.begin(), pathList.end(), [&](auto &&path) {
return componentPath.startsWith(path);
});
}
ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceServer,
const InstanceContainer &instanceContainer,
ComponentWrap componentWrap)
@@ -233,7 +240,9 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
object = Internal::ObjectNodeInstance::createCustomParserObject(instanceContainer.nodeSource(), nodeInstanceServer->importCode(), nodeInstanceServer->context());
if (object == nullptr)
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Custom parser object could not be created."), instanceContainer.instanceId());
} else if (!instanceContainer.componentPath().isEmpty()) {
} else if (!instanceContainer.componentPath().isEmpty()
&& !isInPathList(nodeInstanceServer->engine()->importPathList(),
instanceContainer.componentPath())) {
object = Internal::ObjectNodeInstance::createComponent(instanceContainer.componentPath(), nodeInstanceServer->context());
if (object == nullptr) {
object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context());

View File

@@ -258,7 +258,7 @@ T.ComboBox {
},
State {
name: "edit"
when: myComboBox.enabled && myComboBox.edit && myComboBox.editable && !myComboBox.open
when: myComboBox.enabled && myComboBox.edit && !myComboBox.open
PropertyChanges {
target: myComboBox
wheelEnabled: true

View File

@@ -64,11 +64,15 @@ TextInput {
border.width: 0
}
TapHandler {
id: tapHandler
acceptedDevices: PointerDevice.Mouse
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: true
onTapped: {
hoverEnabled: true
propagateComposedEvents: true
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onPressed: function(mouse) {
if (textInput.readOnly) {
if (myControl.popup.opened) {
myControl.popup.close()
@@ -80,18 +84,9 @@ TextInput {
} else {
textInput.forceActiveFocus()
}
}
}
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: true
hoverEnabled: true
propagateComposedEvents: true
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onPressed: function(mouse) { mouse.accepted = false }
mouse.accepted = false
}
}
states: [
@@ -103,13 +98,10 @@ TextInput {
target: textInputBackground
color: StudioTheme.Values.themeControlBackground
}
PropertyChanges {
target: tapHandler
enabled: true
}
PropertyChanges {
target: mouseArea
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton
}
},
State {
@@ -145,13 +137,10 @@ TextInput {
target: textInputBackground
color: StudioTheme.Values.themeControlBackgroundInteraction
}
PropertyChanges {
target: tapHandler
enabled: false
}
PropertyChanges {
target: mouseArea
cursorShape: Qt.IBeamCursor
acceptedButtons: Qt.NoButton
}
},
State {

View File

@@ -22,6 +22,7 @@
<style name="LineNumber" foreground="#888888" background="#232323"/>
<style name="Link" foreground="#0055ff"/>
<style name="Local"/>
<style name="Parameter"/>
<style name="Number" foreground="#ff55ff"/>
<style name="Occurrences" background="#363636"/>
<style name="Occurrences.Rename" foreground="#ffaaaa" background="#553636"/>

View File

@@ -21,6 +21,7 @@
<style name="LineNumber" foreground="#c7c4c1" background="#efebe7"/>
<style name="Link" foreground="#0000ff"/>
<style name="Local"/>
<style name="Parameter"/>
<style name="Number" foreground="#3f3f3f"/>
<style name="Punctuation"/>
<style name="Operator"/>

View File

@@ -27,6 +27,7 @@
<style name="String" foreground="#e0a000"/>
<style name="Type" foreground="#ff8080"/>
<style name="Local"/>
<style name="Parameter"/>
<style name="Field"/>
<style name="Static" foreground="#55ff55" italic="true"/>
<style name="VirtualMethod" italic="true"/>

View File

@@ -12,7 +12,7 @@
"options":
[
{ "key": "SrcFileName", "value": "main.py" },
{ "key": "PyProjectFile", "value": "main.pyproject" }
{ "key": "PyProjectFile", "value": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" }
],
"pages":

View File

@@ -10,7 +10,7 @@ from %{PySideVersion}.QtQml import QQmlApplicationEngine
if __name__ == "__main__":
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.load(os.fspath(Path(__file__).resolve().parent / "main.qml"))
engine.load(os.fspath(Path(__file__).resolve().parent / "%{QmlFileName}"))
if not engine.rootObjects():
sys.exit(-1)
sys.exit(app.exec_())

View File

@@ -40,7 +40,11 @@
"trDisplayName": "Class name:",
"mandatory": true,
"type": "LineEdit",
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" }
"data":
{
"validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)",
"trText": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}"
}
},
{
"name": "BaseCB",
@@ -64,7 +68,7 @@
"type": "LineEdit",
"trDisplayName": "Project file:",
"mandatory": true,
"data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'pyproject')}" }
"data": { "trText": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" }
}
]
},

View File

@@ -13,7 +13,7 @@
[
{ "key": "SrcFileName", "value": "main.py" },
{ "key": "QmlFileName", "value": "main.qml" },
{ "key": "PyProjectFile", "value": "main.pyproject" },
{ "key": "PyProjectFile", "value": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" },
{ "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" },
{ "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" },
{ "key": "PySideVersion", "value": "%{JS: value('QtVersion').PySideVersion}" }
@@ -105,16 +105,16 @@
[
{
"source": "../main_qtquick.py",
"target": "main.py"
"target": "%{SrcFileName}"
},
{
"source": "main.pyproject",
"target": "main.pyproject",
"target": "%{PyProjectFile}",
"openAsProject": true
},
{
"source": "main.qml.tpl",
"target": "main.qml",
"target": "%{QmlFileName}",
"openInEditor": true
},
{

View File

@@ -11,8 +11,8 @@
"options":
[
{ "key": "SrcFileName", "value": "main.py" },
{ "key": "PyProjectFile", "value": "main.pyproject" }
{ "key": "SrcFileName", "value": "%{MainFileName}" },
{ "key": "PyProjectFile", "value": "%{ProjectFileName}" }
],
"pages":
@@ -40,7 +40,12 @@
"trDisplayName": "Class name:",
"mandatory": true,
"type": "LineEdit",
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" }
"data":
{
"validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)",
"trText": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}"
}
},
{
"name": "BaseCB",
@@ -52,7 +57,7 @@
}
},
{
"name": "SrcFileName",
"name": "MainFileName",
"type": "LineEdit",
"trDisplayName": "Source file:",
"mandatory": true,
@@ -63,7 +68,7 @@
"type": "LineEdit",
"trDisplayName": "Project file:",
"mandatory": true,
"data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'pyproject')}" }
"data": { "trText": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" }
}
]
},

View File

@@ -112,7 +112,7 @@ else() # < Qt 6.2
qt_add_qml_module(Tracing
URI "QtCreator.Tracing"
VERSION "1.0"
NO_CREATE_PLUGIN_TARGET
NO_PLUGIN
QML_FILES
${TRACING_QML_FILES}
RESOURCES

View File

@@ -1196,9 +1196,24 @@ FilePath FilePath::pathAppended(const QString &path) const
FilePath fn = *this;
if (path.isEmpty())
return fn;
if (!fn.m_data.isEmpty() && !fn.m_data.endsWith(QLatin1Char('/')))
fn.m_data.append('/');
fn.m_data.append(path);
if (fn.m_data.isEmpty()) {
fn.m_data = path;
return fn;
}
if (fn.m_data.endsWith('/')) {
if (path.startsWith('/'))
fn.m_data.append(path.mid(1));
else
fn.m_data.append(path);
} else {
if (path.startsWith('/'))
fn.m_data.append(path);
else
fn.m_data.append('/').append(path);
}
return fn;
}

View File

@@ -68,7 +68,7 @@ else() # < Qt 6.2
qt_add_qml_module(PerfProfiler
URI "QtCreator.PerfProfiler"
VERSION "1.0"
NO_CREATE_PLUGIN_TARGET
NO_PLUGIN
QML_FILES
PerfProfilerFlameGraphView.qml
SOURCES

View File

@@ -114,7 +114,7 @@ else() # < Qt 6.2
qt_add_qml_module(QmlProfiler
URI "QtCreator.QmlProfiler"
VERSION "1.0"
NO_CREATE_PLUGIN_TARGET
NO_PLUGIN
QML_FILES
${QMLPROFILER_QML_FILES}
RESOURCES

View File

@@ -1,47 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2019 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.7
import QtQuick.Timeline 1.0
import QtQuick.Controls 2.12
CheckBox {
id: do_not_show_checkBox
width: 268
height: 40
text: qsTr("Do not show this again")
spacing: 12
contentItem: Text {
text:do_not_show_checkBox.text
font.family: "titillium web"
color: "#ffffff"
font.pointSize: 24
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
leftPadding: do_not_show_checkBox.indicator.width + do_not_show_checkBox.spacing
}
}

View File

@@ -23,24 +23,30 @@
**
****************************************************************************/
import QtQuick 2.7
import QtQuick.Controls 2.3
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StudioFonts 1.0
import QtQuick.Layouts 1.0
import projectmodel 1.0
import usagestatistics 1.0
Image {
Rectangle {
id: welcome_splash
width: 800
height: 480
source: "welcome_windows/welcome_1.png"
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "#333d56" }
GradientStop { position: 1.0; color: "#000728" }
}
signal goNext
signal closeClicked
signal configureClicked
property alias doNotShowAgain: do_not_show_checkBox.checked
property alias doNotShowAgain: doNotShowCheckBox.checked
property bool loadingPlugins: true
// called from C++
@@ -65,17 +71,14 @@ Image {
Image {
id: logo
x: 14
y: 8
width: 76
height: 66
fillMode: Image.PreserveAspectFit
x: 16
y: 16
source: "welcome_windows/logo.png"
}
Text {
id: qt_design_studio
x: 13
x: 16
y: 93
width: 250
height: 55
@@ -87,7 +90,7 @@ Image {
Text {
id: software_for_ui
x: 15
x: 16
y: 141
width: 250
height: 30
@@ -100,7 +103,7 @@ Image {
Text {
id: copyright
x: 15
x: 16
y: 183
width: 270
height: 24
@@ -112,7 +115,7 @@ Image {
Text {
id: all_rights_reserved
x: 15
x: 16
y: 207
width: 250
height: 24
@@ -205,13 +208,15 @@ Image {
Image {
id: close_window
x: 779
y: 5
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 8
width: 13
height: 13
fillMode: Image.PreserveAspectFit
source: "welcome_windows/close.png"
opacity: area.containsMouse ? 1 : 0.8
MouseArea {
id: area
hoverEnabled: true
@@ -221,18 +226,30 @@ Image {
}
}
NoShowCheckbox {
id: do_not_show_checkBox
x: -47
y: 430
padding: 0
scale: 0.5
ColumnLayout {
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 16
CheckBox {
id: doNotShowCheckBox
text: qsTr("Do not show this again")
padding: 0
}
CheckBox {
id: usageStatisticCheckBox
text: qsTr("Enable Usage Statistics")
checked: usageStatisticModel.usageStatisticEnabled
padding: 0
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
}
}
RowLayout {
x: 16
y: 330
visible: welcome_splash.loadingPlugins
Text {
@@ -240,6 +257,7 @@ Image {
color: "#ffffff"
text: qsTr("%")
font.pixelSize: 12
RotationAnimator {
target: text1
from: 0
@@ -263,6 +281,7 @@ Image {
color: "#ffffff"
text: qsTr("%")
font.pixelSize: 12
RotationAnimator {
target: text2
from: 0
@@ -276,13 +295,14 @@ Image {
Text {
id: all_rights_reserved1
x: 15
x: 16
y: 75
color: "#ffffff"
text: qsTr("Community Edition")
font.pixelSize: 13
font.family: StudioFonts.titilliumWeb_light
visible: projectModel.communityVersion
ProjectModel {
id: projectModel
}
@@ -291,16 +311,4 @@ Image {
id: usageStatisticModel
}
}
NoShowCheckbox {
id: usageStatisticCheckBox
x: -47
y: 391
text: "Enable Usage Statistics"
padding: 0
scale: 0.5
checked: usageStatisticModel.usageStatisticEnabled
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

View File

@@ -32,7 +32,7 @@
<category>Qt Quick</category>
<order>1</order>
<executable>
<path>%{CurrentProject:QT_INSTALL_BINS}/qml</path>
<path>%{CurrentDocument:Project:QT_INSTALL_BINS}/qml</path>
<path>qml</path>
<arguments>%{CurrentDocument:FilePath}</arguments>
<workingdirectory>%{CurrentDocument:Path}</workingdirectory>

View File

@@ -57,6 +57,8 @@ private slots:
void comparison();
void linkFromString_data();
void linkFromString();
void pathAppended_data();
void pathAppended();
private:
QTemporaryDir tempDir;
@@ -442,5 +444,56 @@ void tst_fileutils::linkFromString_data()
<< QString::fromLatin1("(42)") << 42 << -1;
}
void tst_fileutils::pathAppended()
{
QFETCH(QString, left);
QFETCH(QString, right);
QFETCH(QString, expected);
const FilePath fleft = FilePath::fromString(left);
const FilePath fexpected = FilePath::fromString(expected);
const FilePath result = fleft.pathAppended(right);
QCOMPARE(fexpected, result);
}
void tst_fileutils::pathAppended_data()
{
QTest::addColumn<QString>("left");
QTest::addColumn<QString>("right");
QTest::addColumn<QString>("expected");
QTest::newRow("p0") << "" << "" << "";
QTest::newRow("p1") << "" << "/" << "/";
QTest::newRow("p2") << "" << "c/" << "c/";
QTest::newRow("p3") << "" << "/d" << "/d";
QTest::newRow("p4") << "" << "c/d" << "c/d";
QTest::newRow("r0") << "/" << "" << "/";
QTest::newRow("r1") << "/" << "/" << "/";
QTest::newRow("r2") << "/" << "c/" << "/c/";
QTest::newRow("r3") << "/" << "/d" << "/d";
QTest::newRow("r4") << "/" << "c/d" << "/c/d";
QTest::newRow("s0") << "/b" << "" << "/b";
QTest::newRow("s1") << "/b" << "/" << "/b/";
QTest::newRow("s2") << "/b" << "c/" << "/b/c/";
QTest::newRow("s3") << "/b" << "/d" << "/b/d";
QTest::newRow("s4") << "/b" << "c/d" << "/b/c/d";
QTest::newRow("t0") << "a/" << "" << "a/";
QTest::newRow("t1") << "a/" << "/" << "a/";
QTest::newRow("t2") << "a/" << "c/" << "a/c/";
QTest::newRow("t3") << "a/" << "/d" << "a/d";
QTest::newRow("t4") << "a/" << "c/d" << "a/c/d";
QTest::newRow("u0") << "a/b" << "" << "a/b";
QTest::newRow("u1") << "a/b" << "/" << "a/b/";
QTest::newRow("u2") << "a/b" << "c/" << "a/b/c/";
QTest::newRow("u3") << "a/b" << "/d" << "a/b/d";
QTest::newRow("u4") << "a/b" << "c/d" << "a/b/c/d";
}
QTEST_APPLESS_MAIN(tst_fileutils)
#include "tst_fileutils.moc"

View File

@@ -86,7 +86,7 @@ def setBreakpointsForCurrentProject(filesAndLines):
return None
invokeMenuItem("Debug", "Toggle Breakpoint")
filePath = str(waitForObjectExists(":Qt Creator_FilenameQComboBox").toolTip)
breakPointList.append({os.path.normcase(filePath):lineNumberWithCursor(editor)})
breakPointList.append({filePath:lineNumberWithCursor(editor)})
test.log('Set breakpoint in %s' % curFile, curLine)
try:
breakPointTreeView = waitForObject(":Breakpoints_Debugger::Internal::BreakTreeView")

View File

@@ -102,7 +102,7 @@ def main():
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(getStarted)
if test.verify(all((wsButtonFrame, wsButtonLabel)),
"Verifying: Qt Creator displays Welcome Page with '%s' button." % getStarted):
if clickItemVerifyHelpCombo(wsButtonLabel, "Qt Creator Manual",
if clickItemVerifyHelpCombo(wsButtonLabel, "Getting Started | Qt Creator Manual",
"Verifying: Help with Creator Documentation is being opened."):
textUrls = {'Online Community':'https://forum.qt.io',