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 */ 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() 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/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/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp index ec677718241..b85b518f6b7 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); @@ -327,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; } 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; }); 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); diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 3ad3ac10db4..5d7a48754b8 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -186,9 +186,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; diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index c76efe83c20..f7fa07a842b 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -247,6 +247,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 e43d48fde3e..25ccfa50954 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -89,6 +89,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/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()))); diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 0e333853814..b16b4525142 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) diff --git a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp index 9adc9b2edb7..01db2bd56c5 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/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index f24060b9077..af23aaf688b 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -411,6 +411,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 635ee47f326..a49ae83b892 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.ui +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.ui @@ -28,7 +28,7 @@ false - 0 + 21 @@ -82,222 +82,266 @@ - + - + 10 0 - - - QFormLayout::ExpandingFieldsGrow + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + true + + + + + 0 + 0 + 396 + 444 + - - 0 - - - 0 - - - 0 - - - 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 - - - - - - - Base environment: - - - - - - - - 0 - 0 - - - - - + + + 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 + + + + + + + Base environment: + + + + + + + + 0 + 0 + + + + + + + + + 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; 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 @@ \" \", \" \", \" \", - \" \", - \" \", - \" \", - \" \", - \" \", \" \", \" \", \" \", diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index faf3b16b263..d4cd874a4b9 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; } 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/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()) { diff --git a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp index d979367f87a..b1fcbcb6be4 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); @@ -325,6 +326,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/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); 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); } 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; 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); 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/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 diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index d409d1b93bd..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); @@ -498,8 +509,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) + ":"; 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); diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp index 0c1c47d7cdb..5f999835c53 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 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 - - 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/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 817c384f611..d6223f03cfc 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" @@ -5441,10 +5458,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 +5472,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") 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()