From 5a8b198b9a76d63854bebaa364aae9780890b2fb Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Dec 2018 10:45:04 +0100 Subject: [PATCH 01/27] Debugger: Fix display of multidimensional C arrays Fixes: QTCREATORBUG-19356 Fixes: QTCREATORBUG-20639 Fixes: QTCREATORBUG-21677 Change-Id: Ie28b51c6caf526e125234959cbf11503d0683dc7 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/dumper.py | 52 +++++++++++++++-------------- tests/auto/debugger/tst_dumpers.cpp | 12 +++---- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 1a646ab4e50..c610b112ea2 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -3379,6 +3379,19 @@ class DumperBase: def type(self, typeId): return self.typeData.get(typeId) + def splitArrayType(self, type_name): + # "foo[2][3][4]" -> ("foo", "[3][4]", 2) + pos1 = len(type_name) + # In case there are more dimensions we need the inner one. + while True: + pos1 = type_name.rfind('[', 0, pos1 - 1) + pos2 = type_name.find(']', pos1) + if type_name[pos1 - 1] != ']': + break + + item_count = type_name[pos1+1:pos2] + return (type_name[0:pos1].strip(), type_name[pos2+1:].strip(), int(item_count)) + def registerType(self, typeId, tdata): #warn('REGISTER TYPE: %s' % typeId) self.typeData[typeId] = tdata @@ -3585,16 +3598,6 @@ class DumperBase: def pointer(self): return self.dumper.createPointerType(self) - def splitArrayType(self): - # -> (inner type, count) - if not self.code == TypeCodeArray: - error('Not an array') - s = self.name - pos1 = s.rfind('[') - pos2 = s.find(']', pos1) - itemCount = s[pos1+1:pos2] - return (self.dumper.createType(s[0:pos1].strip()), int(s[pos1+1:pos2])) - def target(self): return self.typeData().ltarget @@ -3613,9 +3616,6 @@ class DumperBase: def bitsize(self): if self.lbitsize is not None: return self.lbitsize - if self.code == TypeCodeArray: - (innerType, itemCount) = self.splitArrayType() - return itemCount * innerType.bitsize() error('DONT KNOW SIZE: %s' % self) def isMovableType(self): @@ -3748,14 +3748,23 @@ class DumperBase: error('Expected type in createArrayType(), got %s' % type(targetType)) targetTypeId = targetType.typeId - typeId = '%s[%d]' % (targetTypeId, count) + + if targetTypeId.endswith(']'): + (prefix, suffix, inner_count) = self.splitArrayType(targetTypeId) + type_id = '%s[%d][%d]%s' % (prefix, count, inner_count, suffix) + type_name = type_id + else: + type_id = '%s[%d]' % (targetTypeId, count) + type_name = '%s[%d]' % (targetType.name, count) + tdata = self.TypeData(self) - tdata.name = '%s[%d]' % (targetType.name, count) - tdata.typeId = typeId + tdata.name = type_name + tdata.typeId = type_id tdata.code = TypeCodeArray tdata.ltarget = targetType - self.registerType(typeId, tdata) - return self.Type(self, typeId) + tdata.lbitsize = targetType.lbitsize * count + self.registerType(type_id, tdata) + return self.Type(self, type_id) def createBitfieldType(self, targetType, bitsize): if not isinstance(targetType, self.Type): @@ -3796,13 +3805,6 @@ class DumperBase: #typish.check() return typish if isinstance(typish, str): - if typish.endswith(']') and not typish.endswith('[]'): - # Array fallback. - pos1 = typish.rfind('[') - itemType = self.createType(typish[0:pos1].strip()) - itemCount = int(typish[pos1+1:-1]) - return self.createArrayType(itemType, itemCount) - def knownSize(tn): if tn[0] == 'Q': if tn in ('QByteArray', 'QString', 'QList', 'QStringList', diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 76b23814bb7..c3a33eb1ad8 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5441,10 +5441,10 @@ void tst_Dumpers::dumper_data() QTest::newRow("Array") << Data("", - "double a1[3][3];\n" + "double a1[3][4];\n" "for (int i = 0; i != 3; ++i)\n" " for (int j = 0; j != 3; ++j)\n" - " a1[i][j] = i + j;\n" + " a1[i][j] = i + 10 * j;\n" "unused(&a1);\n\n" "char a2[20] = { 0 };\n" @@ -5455,11 +5455,11 @@ void tst_Dumpers::dumper_data() "a2[4] = 0;\n" "unused(&a2);\n") - + Check("a1", Pointer(), "double [3][3]") - + Check("a1.0", "[0]", Pointer(), "double [3]") + + Check("a1", Pointer(), "double[3][4]") + + Check("a1.0", "[0]", Pointer(), "double[4]") + Check("a1.0.0", "[0]", FloatValue("0"), "double") - + Check("a1.0.2", "[2]", FloatValue("2"), "double") - + Check("a1.2", "[2]", Pointer(), "double [3]") + + Check("a1.0.2", "[2]", FloatValue("20"), "double") + + Check("a1.2", "[2]", Pointer(), "double[4]") + Check("a2", Value("\"abcd" + QString(16, 0) + '"'), "char [20]") + Check("a2.0", "[0]", "97", "char") From 168533ee78450a676e379f0cbdac9e1d2384a151 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 14 Dec 2018 09:28:41 +0100 Subject: [PATCH 02/27] Debugger: Fix array type element count extraction Task-number: QTCREATORBUG-20639 Task-number: QTCREATORBUG-21677 Change-Id: I518ba2a8afde099535becd3af9bed4ded1b54644 Reviewed-by: hjk Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/pytype.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp index ec677718241..bd08c4b789f 100644 --- a/src/libs/qtcreatorcdbext/pytype.cpp +++ b/src/libs/qtcreatorcdbext/pytype.cpp @@ -105,9 +105,11 @@ static bool isArrayType(const std::string &typeName) static ULONG extractArraySize(const std::string &typeName, size_t openArrayPos = 0) { if (openArrayPos == 0) - openArrayPos = typeName.find_last_of('['); - const auto closeArrayPos = typeName.find_last_of(']'); - if (openArrayPos == std::string::npos || closeArrayPos == std::string::npos) + openArrayPos = typeName.find_first_of('['); + if (openArrayPos == std::string::npos) + return 0; + const auto closeArrayPos = typeName.find_first_of(']', openArrayPos); + if (closeArrayPos == std::string::npos) return 0; const std::string arraySizeString = typeName.substr(openArrayPos + 1, closeArrayPos - openArrayPos - 1); From 5e61e0aa730d825ac0b422192708fb10b5eb6859 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 14 Dec 2018 09:29:10 +0100 Subject: [PATCH 03/27] Debugger: Fix target type parsing for array types Task-number: QTCREATORBUG-20639 Task-number: QTCREATORBUG-21677 Change-Id: I233ad175f9f4d1b7859e4a066505880eb975f49b Reviewed-by: hjk Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/pytype.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp index bd08c4b789f..b85b518f6b7 100644 --- a/src/libs/qtcreatorcdbext/pytype.cpp +++ b/src/libs/qtcreatorcdbext/pytype.cpp @@ -329,8 +329,15 @@ std::string PyType::targetName() const const std::string &typeName = name(); if (isPointerType(typeName)) return stripPointerType(typeName); - if (isArrayType(typeName)) - return typeName.substr(0, typeName.find_last_of('[')); + if (isArrayType(typeName)) { + const auto openArrayPos = typeName.find_first_of('['); + if (openArrayPos == std::string::npos) + return typeName; + const auto closeArrayPos = typeName.find_first_of(']', openArrayPos); + if (closeArrayPos == std::string::npos) + return typeName; + return typeName.substr(0, openArrayPos) + typeName.substr(closeArrayPos + 1); + } return typeName; } From 1d683dcc0730eecdf1054ecc7cbe86695bae3f1d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 23 Nov 2018 10:08:35 +0100 Subject: [PATCH 04/27] Android: Correct setting ANDROID_NDK_PLATFORM Instead of using always just the minimum SDK version we need to differentiate between SDK and NDK version. Fixes: QTCREATORBUG-21536 Change-Id: I2f99c9d40ab05ccd2a4b8efeb2cd0300ecf0cf3a Reviewed-by: BogDan Vatra Reviewed-by: Eike Ziller Reviewed-by: Vikas Pachdha --- src/plugins/android/androidmanager.cpp | 7 +++++++ src/plugins/android/androidmanager.h | 1 + src/plugins/android/androidqtversion.cpp | 16 ++++++++++++++++ src/plugins/android/androidqtversion.h | 2 ++ .../androidqmakebuildconfigurationfactory.cpp | 3 ++- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 336a1befd29..88778a989a8 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -249,6 +249,13 @@ int AndroidManager::minimumSDK(const ProjectExplorer::Kit *kit) return minSDKVersion; } +int AndroidManager::minimumNDK(ProjectExplorer::Target *target) +{ + auto qt = static_cast( + QtSupport::QtKitInformation::qtVersion(target->kit())); + return qt->mininmumNDK(); +} + QString AndroidManager::buildTargetSDK(ProjectExplorer::Target *target) { auto androidBuildApkStep diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 444710ac918..00b1fd12154 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -71,6 +71,7 @@ public: static int minimumSDK(ProjectExplorer::Target *target); static int minimumSDK(const ProjectExplorer::Kit *kit); + static int minimumNDK(ProjectExplorer::Target *target); static QString targetArch(ProjectExplorer::Target *target); diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index eaf47f6481f..a1a6d047bab 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -123,9 +123,25 @@ QString AndroidQtVersion::targetArch() const return m_targetArch; } +int AndroidQtVersion::mininmumNDK() const +{ + ensureMkSpecParsed(); + return m_minNdk; +} + void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const { m_targetArch = evaluator->value(QLatin1String("ANDROID_TARGET_ARCH")); + const QString androidPlatform = evaluator->value(QLatin1String("ANDROID_PLATFORM")); + if (!androidPlatform.isEmpty()) { + const QRegExp regex("android-(\\d+)"); + if (regex.exactMatch(androidPlatform)) { + bool ok = false; + int tmp = regex.cap(1).toInt(&ok); + if (ok) + m_minNdk = tmp; + } + } BaseQtVersion::parseMkSpec(evaluator); } diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 62bbd930c60..d009c68ceb3 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -55,10 +55,12 @@ public: QString description() const override; QString targetArch() const; + int mininmumNDK() const; protected: void parseMkSpec(ProFileEvaluator *) const override; private: mutable QString m_targetArch; + mutable int m_minNdk = -1; }; } // namespace Internal diff --git a/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.cpp b/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.cpp index 308caa4719b..f32330916d0 100644 --- a/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.cpp +++ b/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.cpp @@ -77,7 +77,8 @@ void AndroidQmakeBuildConfiguration::initialize(const BuildInfo *info) void AndroidQmakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const { - QString androidNdkPlatform = AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::minimumSDK(target())); + QString androidNdkPlatform = AndroidConfigurations::currentConfig().bestNdkPlatformMatch( + qMax(AndroidManager::minimumNDK(target()), AndroidManager::minimumSDK(target()))); env.set(QLatin1String("ANDROID_NDK_PLATFORM"), androidNdkPlatform); } From aa8629cbfd089e8dca310e6bae7214adbdb8fdaa Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 29 Nov 2018 10:46:42 +0100 Subject: [PATCH 05/27] Android: Ensure the correct sysroot is passed to debugger Change-Id: Iaa5e026eef658b7b729291beac30788f35c6489a Reviewed-by: BogDan Vatra Reviewed-by: hjk Reviewed-by: Vikas Pachdha --- src/plugins/android/androiddebugsupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 03f322ba784..5025ca74df9 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -147,9 +147,10 @@ void AndroidDebugSupport::start() gdbServer.setPort(m_runner->gdbServerPort().number()); setRemoteChannel(gdbServer); + int sdkVersion = qMax(AndroidManager::minimumSDK(target), AndroidManager::minimumNDK(target)); Utils::FileName sysRoot = AndroidConfigurations::currentConfig().ndkLocation() .appendPath("platforms") - .appendPath(QString("android-%1").arg(AndroidManager::minimumSDK(target))) + .appendPath(QString("android-%1").arg(sdkVersion)) .appendPath(toNdkArch(AndroidManager::targetArch(target))); setSysRoot(sysRoot); qCDebug(androidDebugSupportLog) << "Sysroot: " << sysRoot; From 18bee3a08f9339c0fb33a732a1fe45b2b8a9622c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Dec 2018 10:57:48 +0100 Subject: [PATCH 06/27] Debuger: Fix enum dumper (again) Fixes: QTCREATORBUG-21726 Change-Id: I25f4a84d88a915247456ac8e12877d503ae0d49a Reviewed-by: Christian Stenger --- share/qtcreator/debugger/cdbbridge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/debugger/cdbbridge.py b/share/qtcreator/debugger/cdbbridge.py index 2e7b0a073da..d4aab222bbb 100644 --- a/share/qtcreator/debugger/cdbbridge.py +++ b/share/qtcreator/debugger/cdbbridge.py @@ -189,7 +189,7 @@ class Dumper(DumperBase): self.nativeStructAlignment(nativeType) if code == TypeCodeEnum: tdata.enumDisplay = lambda intval, addr, form : \ - self.nativeTypeEnumDisplay(nativeType, addr, form) + self.nativeTypeEnumDisplay(nativeType, intval, form) tdata.templateArguments = self.listTemplateParameters(nativeType.name()) self.registerType(typeId, tdata) # Fix up fields and template args return self.Type(self, typeId) @@ -215,11 +215,11 @@ class Dumper(DumperBase): align = handleItem(f.type(), align) return align - def nativeTypeEnumDisplay(self, nativeType, addr, form): - value = cdbext.createValue(addr, nativeType) + def nativeTypeEnumDisplay(self, nativeType, intval, form): + value = self.nativeParseAndEvaluate('(%s)%d' % (nativeType.name(), intval)) if value is None: return '' - return enumDisplay(value) + return self.enumValue(value) def enumExpression(self, enumType, enumValue): ns = self.qtNamespace() From 40f2f9971409acf3e2e531411826a01ed5223561 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Dec 2018 09:18:57 +0100 Subject: [PATCH 07/27] SaveFile: Fix error handling when moving file with new contents fails The original content is moved to a backup, then the new file is moved into its place. If that second step fails, we have to at least try to move the backup back into the original place, and definitely not remove the backup. This behavior changed in 0dafe5cb8c8135d365c8cb0d365eae5ce66d268e Task-number: QTCREATORBUG-21724 Change-Id: I996098576c0ceed59dd7359ac4f1b9d33f87d596 Reviewed-by: hjk Reviewed-by: David Schulz --- src/libs/utils/savefile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp index 5864ece3ef0..cac25546dbb 100644 --- a/src/libs/utils/savefile.cpp +++ b/src/libs/utils/savefile.cpp @@ -186,7 +186,8 @@ bool SaveFile::commit() const QString &renameError = m_tempFile->errorString(); m_tempFile->remove(); setErrorString(renameError); - result = false; + QFile::rename(backupName, finalFileName); // rollback to backup if possible ... + return false; // ... or keep the backup copy at least } QFile::remove(backupName); From 2a67a86c2ff0f5a33dee133dc45744d1c5a179c3 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 17 Dec 2018 12:27:02 +0100 Subject: [PATCH 08/27] Debugger: Add fallback when gdb.Value.cast() fails for typedefs Fixes: QTCREATORBUG-18450 Change-Id: I9239beb7e1879a284e28a30579129fe487eb2dd2 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 10 ++++++++-- tests/auto/debugger/tst_dumpers.cpp | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index c6e6adc55fe..efa71b120c5 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -247,8 +247,14 @@ class Dumper(DumperBase): if targetType.code == gdb.TYPE_CODE_ARRAY: val = self.Value(self) else: - # Cast may fail (e.g for arrays, see test for Bug5799) - val = self.fromNativeValue(nativeValue.cast(targetType)) + try: + # Cast may fail for arrays, for typedefs to __uint128_t with + # gdb.error: That operation is not available on integers + # of more than 8 bytes. + # See test for Bug5799, QTCREATORBUG-18450. + val = self.fromNativeValue(nativeValue.cast(targetType)) + except: + val = self.Value(self) #warn('CREATED TYPEDEF: %s' % val) else: val = self.Value(self) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index c3a33eb1ad8..8f78aa7c47d 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5383,6 +5383,23 @@ void tst_Dumpers::dumper_data() + Check("s32s", "-2147483648", TypeDef("int", "@qint32")); + QTest::newRow("Int128") + << Data("#include \n", + "using typedef_s128 = __int128_t;\n" + "using typedef_u128 = __uint128_t;\n" + "__int128_t s128 = 12;\n" + "__uint128_t u128 = 12;\n" + "typedef_s128 ts128 = 12;\n" + "typedef_u128 tu128 = 12;\n" + "unused(&u128, &s128, &tu128, &ts128);\n") + // Sic! The expected type is what gcc 8.2.0 records. + + GdbEngine + + Check("s128", "12", "__int128") + + Check("u128", "12", "__int128 unsigned") + + Check("ts128", "12", "typedef_s128") + + Check("tu128", "12", "typedef_u128") ; + + QTest::newRow("Float") << Data("#include \n", "qfloat16 f1 = 45.3f; unused(&f1);\n" From d6e787e770f43b87138f68d9055d888e9a03e98e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Dec 2018 09:52:46 +0100 Subject: [PATCH 09/27] QmlDesigner: Increase minimum width of property editor This removes a few glitches. Change-Id: I30a4d4551d7061a8000d7f8be69e8166b2a95305 Reviewed-by: Tim Jenssen --- .../components/propertyeditor/propertyeditorview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 98df2867fc2..0467355bf43 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -88,7 +88,7 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) : m_stackedWidget->setStyleSheet(Theme::replaceCssColors( QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css"))))); - m_stackedWidget->setMinimumWidth(320); + m_stackedWidget->setMinimumWidth(340); m_stackedWidget->move(0, 0); connect(m_stackedWidget, &PropertyEditorWidget::resized, this, &PropertyEditorView::updateSize); From e3ac997fd41059b68bc922d03c78a6543af75702 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Dec 2018 12:20:01 +0100 Subject: [PATCH 10/27] QmlDesigner: Escape colors Change-Id: I02b592f2f6f06eb5ab36dc2dc2eaa96f2ffd3b7d Reviewed-by: Knud Dollereder Reviewed-by: Tim Jenssen --- .../qmldesigner/designercore/model/rewriterview.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index d409d1b93bd..80d9d374843 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -498,8 +498,13 @@ QString RewriterView::auxiliaryDataAsQML() const const QVariant value = data.value(key.toUtf8()); QString strValue = value.toString(); - if (static_cast(value.type()) == QMetaType::QString) + + auto metaType = static_cast(value.type()); + + if (metaType == QMetaType::QString + || metaType == QMetaType::QColor) { strValue = "\"" + strValue + "\""; + } if (!strValue.isEmpty()) { str += replaceIllegalPropertyNameChars(key) + ":"; From 6be16322123df2f21febe320d04b4804f3e6cdcc Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Dec 2018 14:35:40 +0100 Subject: [PATCH 11/27] QmlDesigner: Set text editor to modified if auxiliaryData is changed The auxiliaryData is stored in a meta comment when saving. Therefore the document is modified, once an auxiliaryData is changed. Change-Id: If27015b7904754bab4e5d4d50939d3d55469cc6b Reviewed-by: Knud Dollereder Reviewed-by: Tim Jenssen --- .../qmldesigner/designercore/include/rewriterview.h | 2 ++ .../qmldesigner/designercore/model/rewriterview.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index 51e88892ac5..fa2147f9b69 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -109,6 +109,8 @@ public: void reactivateTextMofifierChangeSignals(); void deactivateTextMofifierChangeSignals(); + void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data) override; + Internal::ModelNodePositionStorage *positionStorage() const; QList warnings() const; diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index 80d9d374843..72f8ff1e3a7 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -387,6 +387,17 @@ void RewriterView::deactivateTextMofifierChangeSignals() textModifier()->deactivateChangeSignals(); } +void RewriterView::auxiliaryDataChanged(const ModelNode &, const PropertyName &name, const QVariant &) +{ + if (name.endsWith("@NodeInstance")) + return; + + if (name.endsWith("@Internal")) + return; + + m_textModifier->textDocument()->setModified(true); +} + void RewriterView::applyModificationGroupChanges() { Q_ASSERT(transactionLevel == 0); From 267c1860f69a34dc05518ece8c55fd9653aa61c0 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 11 Dec 2018 10:42:04 +0100 Subject: [PATCH 12/27] QmlDesigner: remove includes Change-Id: I1524ae49e935624c03296b5626fd524ec06aa2f7 Reviewed-by: Thomas Hartmann --- .../qmldesigner/designercore/instances/nodeinstanceview.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 9a8527e6591..62f12d910c8 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -26,8 +26,6 @@ #include "nodeinstanceview.h" #include -#include -#include #include #include From f377e81ca7b4b4f983b9771b90279fe28cfe7849 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 13 Dec 2018 23:12:26 +0100 Subject: [PATCH 13/27] QmlDesigner: show zoom percentage as tooltip Because of wrong dpi behavior sometimes the combobox is not big enough to show the complete zoom value, with tooltip it can be made visible. Change-Id: Id3ef7b677ea8302e0a332ff9f118483b9bff8178 Reviewed-by: Thomas Hartmann --- .../components/componentcore/zoomaction.cpp | 24 +++++++++---------- .../components/componentcore/zoomaction.h | 3 --- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp index 11fcad983ff..9a1529414a9 100644 --- a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp +++ b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp @@ -99,13 +99,24 @@ QWidget *ZoomAction::createWidget(QWidget *parent) } comboBox->setCurrentIndex(m_currentComboBoxIndex); + comboBox->setToolTip(comboBox->currentText()); connect(this, &ZoomAction::reseted, comboBox, [this, comboBox]() { blockSignals(true); comboBox->setCurrentIndex(m_currentComboBoxIndex); blockSignals(false); }); connect(comboBox, static_cast(&QComboBox::currentIndexChanged), - this, &ZoomAction::emitZoomLevelChanged); + [this, comboBox](int index) { + m_currentComboBoxIndex = index; + + if (index == -1) + return; + + const QModelIndex modelIndex(m_comboBoxModel.data()->index(index, 0)); + setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toFloat()); + comboBox->setToolTip(modelIndex.data().toString()); + }); + connect(this, &ZoomAction::indexChanged, comboBox, &QComboBox::setCurrentIndex); comboBox->setProperty("hideborder", true); @@ -113,15 +124,4 @@ QWidget *ZoomAction::createWidget(QWidget *parent) return comboBox; } -void ZoomAction::emitZoomLevelChanged(int index) -{ - m_currentComboBoxIndex = index; - - if (index == -1) - return; - - const QModelIndex modelIndex(m_comboBoxModel.data()->index(index, 0)); - setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toFloat()); -} - } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/componentcore/zoomaction.h b/src/plugins/qmldesigner/components/componentcore/zoomaction.h index 2bf02191240..e93298d137a 100644 --- a/src/plugins/qmldesigner/components/componentcore/zoomaction.h +++ b/src/plugins/qmldesigner/components/componentcore/zoomaction.h @@ -56,9 +56,6 @@ signals: void indexChanged(int); void reseted(); -private: - void emitZoomLevelChanged(int index); - private: QPointer m_comboBoxModel; float m_zoomLevel; From 6247b243929b6fe675f4da3a5413b067838fd67b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Dec 2018 16:32:17 +0100 Subject: [PATCH 14/27] Do not force an artificially high minimum size on the options dialog We want it to have a reasonable first-use size, but we can just set that manually when opening it the first time. Afterwards the geometry is restored from the settings. All pages already have a vertical scrollbar available, but that also forced a relatively large minimum size. Reduce this. Fix-up of dba102ff618496b16c2f3b4772cea7a323946606 and 63be3a4024ff5e4755506295d9e861afd96a9ca6 Fixes: QTCREATORBUG-21678 Change-Id: Iff5810b6ebfe51e3fe4da528bc859598c8df2bb4 Reviewed-by: Tobias Hunger --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index ddb91fe469f..596d498875a 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -56,6 +56,11 @@ #include #include +const int kInitialWidth = 750; +const int kInitialHeight = 450; +const int kMaxMinimumWidth = 250; +const int kMaxMinimumHeight = 250; + static const char pageKeyC[] = "General/LastPreferencePage"; const int categoryIconSize = 24; @@ -362,8 +367,8 @@ private: QSize minSize = inner->minimumSizeHint(); minSize += QSize(fw, fw); minSize += QSize(scrollBarWidth(), 0); - minSize.setHeight(qMin(minSize.height(), 450)); - minSize.setWidth(qMin(minSize.width(), 810)); + minSize.setWidth(qMin(minSize.width(), kMaxMinimumWidth)); + minSize.setHeight(qMin(minSize.height(), kMaxMinimumHeight)); return minSize; } return QSize(0, 0); @@ -547,7 +552,6 @@ void SettingsDialog::createGui() m_stackedLayout->setMargin(0); QWidget *emptyWidget = new QWidget(this); - emptyWidget->setMinimumSize(QSize(500, 500)); m_stackedLayout->addWidget(emptyWidget); // no category selected, for example when filtering QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | @@ -740,6 +744,8 @@ bool SettingsDialog::execDialog() static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize"); if (ICore::settings()->contains(kPreferenceDialogSize)) resize(ICore::settings()->value(kPreferenceDialogSize).toSize()); + else + resize(kInitialWidth, kInitialHeight); exec(); m_running = false; m_instance = nullptr; From b341134bc7187ac27165f0f2ddc19c1e421262ae Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Dec 2018 10:07:48 +0100 Subject: [PATCH 15/27] UpdateInfo: Fix unneeded scroll bar in options page The vertical spacer at the bottom had a large minimum size, which made it require a scroll bar for something that is not even visibly doing anything. Change-Id: I66170ceaf0a05b71f103eea518084b6ec6e5f38f Reviewed-by: Jarek Kobus --- src/plugins/updateinfo/settingspage.ui | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/updateinfo/settingspage.ui b/src/plugins/updateinfo/settingspage.ui index de6357b9568..5efc6b1b88e 100644 --- a/src/plugins/updateinfo/settingspage.ui +++ b/src/plugins/updateinfo/settingspage.ui @@ -135,12 +135,6 @@ Qt::Vertical - - - 20 - 233 - - From a1fbfb5513e6bbfeb1ba7b1686e9ce5034167382 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Dec 2018 12:14:50 +0100 Subject: [PATCH 16/27] Kit Preferences: Avoid possibly huge horizontal detail widget size The preferred size of combo boxes can depend on the contents, so if there were large items in e.g. the tool chain or debugger drop downs, the horizontal size of the kit details was getting very big. So ignore the preferred size of combo boxes. Change-Id: Ic59afd6ce73c491e7df46d1159dfea58e978dad1 Reviewed-by: hjk --- src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp | 1 + src/plugins/debugger/debuggerkitconfigwidget.cpp | 1 + src/plugins/projectexplorer/kitinformationconfigwidget.cpp | 2 ++ src/plugins/qtsupport/qtkitconfigwidget.cpp | 1 + 4 files changed, 5 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp index 47eeef30a80..7802863770e 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp @@ -63,6 +63,7 @@ CMakeKitConfigWidget::CMakeKitConfigWidget(Kit *kit, m_comboBox(new QComboBox), m_manageButton(new QPushButton(KitConfigWidget::msgManage())) { + m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); m_comboBox->setEnabled(false); m_comboBox->setToolTip(toolTip()); diff --git a/src/plugins/debugger/debuggerkitconfigwidget.cpp b/src/plugins/debugger/debuggerkitconfigwidget.cpp index 241770c4377..1486e7a08cf 100644 --- a/src/plugins/debugger/debuggerkitconfigwidget.cpp +++ b/src/plugins/debugger/debuggerkitconfigwidget.cpp @@ -67,6 +67,7 @@ DebuggerKitConfigWidget::DebuggerKitConfigWidget(Kit *workingCopy, const KitInfo : KitConfigWidget(workingCopy, ki) { m_comboBox = new QComboBox; + m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); m_comboBox->setEnabled(true); refresh(); diff --git a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp index c6fafe74699..624c7a099b9 100644 --- a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp @@ -150,6 +150,7 @@ ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, const foreach (Core::Id l, languageList) { layout->addWidget(new QLabel(ToolChainManager::displayNameOfLanguageId(l) + ':'), row, 0); auto cb = new QComboBox; + cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy()); cb->setToolTip(toolTip()); m_languageComboboxMap.insert(l, cb); @@ -327,6 +328,7 @@ DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *workingCopy, c m_comboBox(new QComboBox), m_model(new DeviceManagerModel(DeviceManager::instance())) { + m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); m_comboBox->setModel(m_model); m_manageButton = new QPushButton(KitConfigWidget::msgManage()); diff --git a/src/plugins/qtsupport/qtkitconfigwidget.cpp b/src/plugins/qtsupport/qtkitconfigwidget.cpp index d9dfca08fc4..53c6421038c 100644 --- a/src/plugins/qtsupport/qtkitconfigwidget.cpp +++ b/src/plugins/qtsupport/qtkitconfigwidget.cpp @@ -44,6 +44,7 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, const ProjectExplo KitConfigWidget(k, ki) { m_combo = new QComboBox; + m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy()); m_combo->addItem(tr("None"), -1); QList versionIds = Utils::transform(QtVersionManager::versions(), &BaseQtVersion::uniqueId); From 8669a83e162c4600754836eb836446fa8c369a96 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 18 Dec 2018 15:57:38 +0100 Subject: [PATCH 17/27] Debugger: Update global breakpoint line and file ... when a breakpoint in an active engine is moved due to code edits. Change-Id: Iac8102b7ac0149342ccb3fd6be6bf16172683036 Reviewed-by: Orgad Shaneh --- src/plugins/debugger/breakhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 94c8a5f1e5b..c1a58a2b37a 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -102,6 +102,8 @@ public: TextMark::updateLineNumber(lineNumber); QTC_ASSERT(m_bp, return); m_bp->setLineNumber(lineNumber); + if (GlobalBreakpoint gbp = m_bp->globalBreakpoint()) + gbp->m_params.lineNumber = lineNumber; } void updateFileName(const FileName &fileName) final @@ -109,6 +111,8 @@ public: TextMark::updateFileName(fileName); QTC_ASSERT(m_bp, return); m_bp->setFileName(fileName.toString()); + if (GlobalBreakpoint gbp = m_bp->globalBreakpoint()) + gbp->m_params.fileName = fileName.toString(); } bool isDraggable() const final { return true; } From 83fb81df35a62e6366689f2644281605ea134128 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Dec 2018 14:40:15 +0100 Subject: [PATCH 18/27] CppTools: Fix categorization of *.inl, *.tpp, and similar These are files that are included like headers, and not compiled themselves, so e.g. adding them to a project should not categorize them as source files. Fixes: QTCREATORBUG-21736 Change-Id: I7dafba02896d12160de5eed458b99144df0a5f37 Reviewed-by: Ivan Donchevskii Reviewed-by: Marco Bubke Reviewed-by: hjk --- src/plugins/cpptools/CppTools.json.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/cpptools/CppTools.json.in b/src/plugins/cpptools/CppTools.json.in index 22fb394e411..3b7680337db 100644 --- a/src/plugins/cpptools/CppTools.json.in +++ b/src/plugins/cpptools/CppTools.json.in @@ -54,6 +54,11 @@ \" \", \" \", \" \", + \" \", + \" \", + \" \", + \" \", + \" \", \" \", @@ -74,11 +79,6 @@ \" \", \" \", \" \", - \" \", - \" \", - \" \", - \" \", - \" \", \" \", \" \", \" \", From 4c1efb94d5fdec06619714cad6bc69a429e2c1f5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Dec 2018 09:19:54 +0100 Subject: [PATCH 19/27] Preferences: Add scroll area to external tool details That is nicer than scrolling the whole widget including the tools tree. Also make the field for standard input extend. Change-Id: Ia2690015b6014e595c3ba441cd3110389aac6dde Reviewed-by: Alessandro Portale --- .../coreplugin/dialogs/externaltoolconfig.cpp | 2 + .../coreplugin/dialogs/externaltoolconfig.ui | 407 ++++++++++-------- 2 files changed, 232 insertions(+), 177 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index 3e5255ea598..9b17d200032 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -402,6 +402,8 @@ ExternalToolConfig::ExternalToolConfig(QWidget *parent) : m_model(new ExternalToolModel(this)) { ui->setupUi(this); + ui->scrollArea->viewport()->setAutoFillBackground(false); + ui->scrollAreaWidgetContents->setAutoFillBackground(false); ui->toolTree->setModel(m_model); ui->toolTree->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.ui b/src/plugins/coreplugin/dialogs/externaltoolconfig.ui index 24a75872ba1..651ae0fbb6f 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.ui +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.ui @@ -28,7 +28,7 @@ false - 0 + 21 @@ -82,196 +82,249 @@ - + - + 10 0 - - - QFormLayout::ExpandingFieldsGrow + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + true + + + + + 0 + 0 + 396 + 444 + - - 0 - - - - - Description: - - - - - - - - - - Executable: - - - - - - - Utils::PathChooser::Command - - - - - - - Arguments: - - - - - - - - - - Working directory: - - - - - - - Utils::PathChooser::Directory - - - - - - - <html><head/><body> + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 10 + 0 + + + + + QFormLayout::ExpandingFieldsGrow + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Description: + + + + + + + + + + Executable: + + + + + + + + + + Arguments: + + + + + + + + + + Working directory: + + + + + + + + + + <html><head/><body> <p>What to do with the executable's standard output. <ul><li>Ignore: Do nothing with it.</li><li>Show in pane: Show it in the general output pane.</li><li>Replace selection: Replace the current selection in the current document with it.</li></ul></p></body></html> - - - Output: - - - - - - - - Ignore - - - - - Show in Pane - - - - - Replace Selection - - - - - - - - <html><head><body> + + + Output: + + + + + + + + Ignore + + + + + Show in Pane + + + + + Replace Selection + + + + + + + + <html><head><body> <p >What to do with the executable's standard error output.</p> <ul><li>Ignore: Do nothing with it.</li> <li>Show in pane: Show it in the general output pane.</li> <li>Replace selection: Replace the current selection in the current document with it.</li> </ul></body></html> - - - Error output: - - - - - - - - Ignore - - - - - Show in Pane - - - - - Replace Selection - - - - - - - - Environment: - - - - - - - 0 - - - - - - 0 - 0 - - - - No changes to apply. - - - - - - - Change... - - - - - - - - - If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished. - - - Modifies current document - - - - - - - Text to pass to the executable via standard input. Leave empty if the executable should not receive any input. - - - Input: - - - - - - - QPlainTextEdit::NoWrap - - - - + + + Error output: + + + + + + + + Ignore + + + + + Show in Pane + + + + + Replace Selection + + + + + + + + Environment: + + + + + + + 0 + + + + + + 0 + 0 + + + + No changes to apply. + + + + + + + Change... + + + + + + + + + If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished. + + + Modifies current document + + + + + + + Text to pass to the executable via standard input. Leave empty if the executable should not receive any input. + + + Input: + + + + + + + + 0 + 10 + + + + QPlainTextEdit::NoWrap + + + + + + + + From b1aef444e234faa888e4a71731bf888281a62358 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Dec 2018 12:43:17 +0100 Subject: [PATCH 20/27] Toolchain options: Enable horizontal scrollbar for details The scroll area was introduced for the large vertical size of the custom tool chain configuration widget, but actually the ABI setting for the non-custom tool chains is pretty wide and can require horizontal scrolling. Show a horizontal scroll bar too, if needed. Change-Id: Ied926c4b9f2add4ae7164346a9b068b4055e777d Reviewed-by: Alessandro Portale --- src/plugins/projectexplorer/toolchainconfigwidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/projectexplorer/toolchainconfigwidget.cpp b/src/plugins/projectexplorer/toolchainconfigwidget.cpp index 2bfe9b34030..96e021a867b 100644 --- a/src/plugins/projectexplorer/toolchainconfigwidget.cpp +++ b/src/plugins/projectexplorer/toolchainconfigwidget.cpp @@ -47,7 +47,6 @@ ToolChainConfigWidget::ToolChainConfigWidget(ToolChain *tc) : auto centralWidget = new Utils::DetailsWidget; centralWidget->setState(Utils::DetailsWidget::NoSummary); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setFrameShape(QFrame::NoFrame); setWidgetResizable(true); setFocusPolicy(Qt::NoFocus); From e1a25c6923cc460403451aecdcf88aa0009d508b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Dec 2018 16:24:14 +0100 Subject: [PATCH 21/27] Color scheme: Reduce minimum size and add scroll area to details First thing that should happen when reducing the size of the preferences dialog is to add a vertical scroll bar to the color scheme details, not to the whole settings page. Change-Id: Ifaa6d21627f26ec1a6426cdae2477f6143454c57 Reviewed-by: Alessandro Portale --- src/plugins/texteditor/colorschemeedit.cpp | 2 + src/plugins/texteditor/colorschemeedit.ui | 1229 ++++++++++---------- src/plugins/texteditor/fontsettingspage.ui | 4 +- 3 files changed, 643 insertions(+), 592 deletions(-) diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp index 8049c191a35..ff5bc543cb5 100644 --- a/src/plugins/texteditor/colorschemeedit.cpp +++ b/src/plugins/texteditor/colorschemeedit.cpp @@ -152,6 +152,8 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) : { setContentsMargins(0, layoutSpacing, 0, 0); m_ui->setupUi(this); + m_ui->detailsScrollArea->viewport()->setAutoFillBackground(false); + m_ui->scrollAreaWidgetContents->setAutoFillBackground(false); m_ui->itemList->setModel(m_formatsModel); populateUnderlineStyleComboBox(); diff --git a/src/plugins/texteditor/colorschemeedit.ui b/src/plugins/texteditor/colorschemeedit.ui index fa31aa590d2..e9bb34596ba 100644 --- a/src/plugins/texteditor/colorschemeedit.ui +++ b/src/plugins/texteditor/colorschemeedit.ui @@ -7,10 +7,10 @@ 0 0 462 - 389 + 416 - + 0 @@ -23,296 +23,11 @@ 0 - - 0 - - - - - - 75 - true - - - - Relative Foreground - - - - - - - - 0 - 0 - - - - Foreground: - - - foregroundToolButton - - - - - - - - 0 - 0 - - - - - 0 - 18 - - - - - 16777215 - 18 - - - - - - - - - 0 - 0 - - - - Lightness: - - - - - - - - 0 - 0 - - - - - - - - - - - Qt::Vertical - - - - 200 - 0 - - - - - - - - - 0 - 0 - - - - Erase background. - - - x - - - Qt::LeftArrow - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - -1.000000000000000 - - - 1.000000000000000 - - - 0.050000000000000 - - - - - - - - 0 - 0 - - - - Lightness: - - - - - - - - 0 - 0 - - - - Erase foreground. - - - x - - - Qt::LeftArrow - - - - - - - - 0 - 0 - - - - Saturation: - - - - - - - Italic - - - - - - - -1.000000000000000 - - - 1.000000000000000 - - - 0.050000000000000 - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - -1.000000000000000 - - - 1.000000000000000 - - - 0.050000000000000 - - - - - - - - 0 - 0 - - - - Background: - - - backgroundToolButton - - - - - - - - 0 - 0 - - - - - 0 - 18 - - - - - 16777215 - 18 - - - - - + - 1 + 0 0 @@ -324,316 +39,650 @@ - - - - - 75 - true - - - - Font - - - - - + + - + 0 0 - - Saturation: + + QFrame::NoFrame - - - - - - Bold + + QFrame::Plain - - - - - - - 0 - 0 - + + Qt::ScrollBarAlwaysOff - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - - 0 - 0 - - - - - 0 - 18 - - - - - 16777215 - 18 - - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - - 0 - 0 - - - - - - - - - - - - 75 - true - - - - Underline - - - - - - - - 0 - 0 - - - - Color: - - - backgroundToolButton - - - - - - - - 75 - true - - - - Relative Background - - - - - - - - 0 - 0 - - - - - 0 - 18 - - - - - 16777215 - 18 - - - - - - - - -1.000000000000000 - - - 1.000000000000000 - - - 0.050000000000000 - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Erase background. - - - x - - - Qt::LeftArrow - - - - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - - - - - - - - - 0 - 0 - - - - - 0 - 6 - - - - - 16777215 - 6 - + + QAbstractScrollArea::AdjustToContents + + + + 0 + 0 + 212 + 390 + + + + + QLayout::SetFixedSize + + + 0 + + + 0 + + + 20 + + + 0 + + + 0 + + + + + + 75 + true + + + + Relative Foreground + + + + + + + + 0 + 0 + + + + Foreground: + + + foregroundToolButton + + + + + + + + 0 + 0 + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + + + + + + 0 + 0 + + + + Lightness: + + + + + + + + 0 + 0 + + + + + + + + + + + Qt::Vertical + + + + 200 + 0 + + + + + + + + + 0 + 0 + + + + Erase background. + + + x + + + Qt::LeftArrow + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.050000000000000 + + + + + + + + 0 + 0 + + + + Lightness: + + + + + + + + 0 + 0 + + + + Erase foreground. + + + x + + + Qt::LeftArrow + + + + + + + + 0 + 0 + + + + Saturation: + + + + + + + Italic + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.050000000000000 + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.050000000000000 + + + + + + + + 0 + 0 + + + + Background: + + + backgroundToolButton + + + + + + + + 0 + 0 + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + + + + + + 75 + true + + + + Font + + + + + + + + 0 + 0 + + + + Saturation: + + + + + + + Bold + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + + 0 + 0 + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + + 0 + 0 + + + + + + + + + + + + 75 + true + + + + Underline + + + + + + + + 0 + 0 + + + + Color: + + + backgroundToolButton + + + + + + + + 75 + true + + + + Relative Background + + + + + + + + 0 + 0 + + + + + 0 + 18 + + + + + 16777215 + 18 + + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.050000000000000 + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Erase background. + + + x + + + Qt::LeftArrow + + + + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + + + + 0 + 0 + + + + + 0 + 6 + + + + + 16777215 + 6 + + + + + + diff --git a/src/plugins/texteditor/fontsettingspage.ui b/src/plugins/texteditor/fontsettingspage.ui index c47c4eb9407..8c3a0baa50f 100644 --- a/src/plugins/texteditor/fontsettingspage.ui +++ b/src/plugins/texteditor/fontsettingspage.ui @@ -6,7 +6,7 @@ 0 0 - 614 + 639 306 @@ -173,7 +173,7 @@ - + 0 1 From 838919e483b5f5011474fe242ca9fde20dcd0ab3 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 17 Dec 2018 14:43:15 +0100 Subject: [PATCH 22/27] Doc: Add a note on disk space requirements for core dumps Task-number: QTCREATORBUG-21724 Change-Id: I23605be42a53226417041fb24ff7bd90bb384f34 Reviewed-by: Leena Miettinen --- doc/src/debugger/creator-only/creator-debugger.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/src/debugger/creator-only/creator-debugger.qdoc b/doc/src/debugger/creator-only/creator-debugger.qdoc index e9adadbf59b..cca7b5773b5 100644 --- a/doc/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/src/debugger/creator-only/creator-debugger.qdoc @@ -619,6 +619,11 @@ Double-click on entries in the \uicontrol {Debugger Perspectives} view to switch between snapshots. The debugger views are updated to reflect the state of the program at time of taking the snapshot. + + \note Creating snapshots involves creating core files of the debugged process, + requiring significant amount of disk space. For details, see + \l{https://sourceware.org/gdb/onlinedocs/gdb/Core-File-Generation.html}. + \endomit */ From 8eac37ae76a0f165be2df2dd2ba261df1c69db8d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 20 Dec 2018 12:43:21 +0100 Subject: [PATCH 23/27] Fix crash when renaming file in file system view Do not actually rename while iterating through the folders, first test, rename later. Fix-up of 0c9c747d92b7f263b386ea89d82887dc59a24773 which looks like it actually tried to do that, but confused the two method calls. Fixes: QTCREATORBUG-21741 Change-Id: I779e526e76651b61ffc75be6b4dfce1765bb758b Reviewed-by: Robert Loehning --- src/plugins/projectexplorer/foldernavigationwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index b58b9300b83..04948cb219c 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -203,7 +203,7 @@ static QVector renamableFolderNodes(const Utils::FileName &before, ProjectTree::forEachNode([&](Node *node) { if (node->nodeType() == NodeType::File && node->filePath() == before && node->parentFolderNode() - && node->parentFolderNode()->renameFile(before.toString(), after.toString())) { + && node->parentFolderNode()->canRenameFile(before.toString(), after.toString())) { folderNodes.append(node->parentFolderNode()); } }); @@ -239,7 +239,7 @@ bool FolderNavigationModel::setData(const QModelIndex &index, const QVariant &va Utils::FileName::fromString(afterFilePath)); QVector failedNodes; for (FolderNode *folder : folderNodes) { - if (!folder->canRenameFile(beforeFilePath, afterFilePath)) + if (!folder->renameFile(beforeFilePath, afterFilePath)) failedNodes.append(folder); } if (!failedNodes.isEmpty()) { From 4cc32d411abd42b941e2f5267d45c0b72d18d737 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 5 Dec 2018 12:51:30 +0100 Subject: [PATCH 24/27] Clang: Fix highlighting lambda captures This fixes the basic case, but e.g. captures with initializers, e.g. [foo=bar] are not properly reported by libclang and thus "bar" is still not highlighted for this case. Task-number: QTCREATORBUG-15271 Change-Id: I1a2d465f71b0ae1a0406ef9e77d88898e8637958 Reviewed-by: Marco Bubke Reviewed-by: Ivan Donchevskii --- src/tools/clangbackend/source/tokeninfo.cpp | 3 ++- tests/unit/unittest/tokenprocessor-test.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tools/clangbackend/source/tokeninfo.cpp b/src/tools/clangbackend/source/tokeninfo.cpp index b7e40d0327b..de40a954e16 100644 --- a/src/tools/clangbackend/source/tokeninfo.cpp +++ b/src/tools/clangbackend/source/tokeninfo.cpp @@ -372,7 +372,8 @@ void TokenInfo::identifierKind(const Cursor &cursor, Recursion recursion) break; case CXCursor_ParmDecl: case CXCursor_VarDecl: - variableKind(cursor); + case CXCursor_VariableRef: + variableKind(cursor.referenced()); break; case CXCursor_DeclRefExpr: identifierKind(cursor.referenced(), Recursion::RecursivePass); diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index f48d546cb10..3383c9a3b93 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -1697,6 +1697,13 @@ TEST_F(TokenProcessor, DISABLED_NonConstArgumentConstructor) ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument)); } +TEST_F(TokenProcessor, LambdaLocalVariableCapture) +{ + const auto infos = translationUnit.tokenInfosInRange(sourceRange(442, 47)); + + ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable)); +} + Data *TokenProcessor::d; void TokenProcessor::SetUpTestCase() From 2bb24633ac0ad0b8e8e72ef4d0737e30130d946f Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 3 Jan 2019 20:53:24 +0100 Subject: [PATCH 25/27] FileInProjectFinder: Fix findFile() for nonexisting files The comment above this function says: If all fails, it returns the original path from the file URL. That broke with 7b0b4c92cdd, which caused the auto tests in QtSupportPlugin::testQtOutputFormatter to fail. Fixes: QTCREATORBUG-21792 Change-Id: I9ed66c86e7a165fe198ee3fcf1bf8b72d850a2d5 Reviewed-by: Orgad Shaneh Reviewed-by: Ulf Hermann --- src/libs/utils/fileinprojectfinder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 33a779a91d2..2be64260e8a 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -144,7 +144,7 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const if (originalPath.isEmpty()) // e.g. qrc:// originalPath = fileUrl.path(); - QString result; + QString result = originalPath; bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) { result = fileName; }); From 5ed848fd8f56e714d4c318dcb3f50ffd664dee15 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sat, 29 Dec 2018 08:11:30 +0100 Subject: [PATCH 26/27] Autotest: Fix displaying UTF-8 characters in text output pane Fixes: QTCREATORBUG-21782 Change-Id: I0533a1f616d0fee6b7d22ca9854dc992eb4622a4 Reviewed-by: Christian Stenger --- src/plugins/autotest/testresultspane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index c67cd15ae56..1c7af88bfa9 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -237,7 +237,7 @@ void TestResultsPane::addTestResult(const TestResultPtr &result) void TestResultsPane::addOutput(const QByteArray &output) { - m_textOutput->appendPlainText(QString::fromLatin1(TestOutputReader::chopLineBreak(output))); + m_textOutput->appendPlainText(QString::fromUtf8(TestOutputReader::chopLineBreak(output))); } QWidget *TestResultsPane::outputWidget(QWidget *parent) From bcafe202c9f8a7c4bad4cf60095138b1d6cbf2ac Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 30 Dec 2018 15:45:04 +0100 Subject: [PATCH 27/27] AutoTest: Allow redefinition of integrated QTest macros Undefining the macro could lead to a crash when evaluating the arguments; at least the test was not recognized (probably as the loop was exited at the first ocurrence of the macro name). Use case: #ifdef QTEST_APPLESS_MAIN # undef QTEST_APPLESS_MAIN # define QTEST_APPLESS_MAIN TF_TEST_MAIN #endif QTEST_APPLESS_MAIN(tst_MyClass) Task-number: QTCREATORBUG-19910 Change-Id: I9f935f82a30b9681398e5d93fccfe6d474765022 Reviewed-by: Robert Szefner Reviewed-by: Christian Stenger --- src/plugins/autotest/qtest/qttestparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp index b806e79f8d3..234aeca79f9 100644 --- a/src/plugins/autotest/qtest/qttestparser.cpp +++ b/src/plugins/autotest/qtest/qttestparser.cpp @@ -107,7 +107,7 @@ static QString testClass(const CppTools::CppModelManager *modelManager, if (!macro.isFunctionLike()) continue; const QByteArray name = macro.macro().name(); - if (QTestUtils::isQTestMacro(name)) { + if (QTestUtils::isQTestMacro(name) && !macro.arguments().isEmpty()) { const CPlusPlus::Document::Block arg = macro.arguments().at(0); return QLatin1String(fileContent.mid(int(arg.bytesBegin()), int(arg.bytesEnd() - arg.bytesBegin())));