From 987cd409f3c6daa6ebe67e3fe551c60ccb0c3a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 17 Apr 2024 22:54:58 +0200 Subject: [PATCH 1/6] SquishTests: Make sure that button in Designer is renamed properly This misused typeLines() to close the dialog by pressing "Return". Although the entire name of the button should be selected at first, I witnessed the new name being appended to the old one. The new code uses replaceEditorContent() to explicit select the old name and replace it with the new name. After that, it explicitly presses "Return" to close the dialog. Change-Id: I5ec946f57000396b70428e08ab795a1ee3eba91a Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/suite_tools/tst_designer_autocomplete/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index c72d86a4e2e..b378407f812 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -25,7 +25,9 @@ def main(): openContextMenu(waitForObject("{container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack'" "text='PushButton' type='QPushButton' visible='1'}"), 5, 5, 1) activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Change objectName...")) - typeLines(waitForObject(":FormEditorStack_qdesigner_internal::PropertyLineEdit"), buttonName) + buttonNameEdit = waitForObject(":FormEditorStack_qdesigner_internal::PropertyLineEdit") + replaceEditorContent(buttonNameEdit, buttonName) + type(buttonNameEdit, "") else: # Verify that everything works without ever changing the name buttonName = "pushButton" From 7f7d4889d26b11e26d066d870da73ba5912f2988 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 23 Apr 2024 14:00:04 +0200 Subject: [PATCH 2/6] Add an environment variable for disabling atomic save There are situations where e.g. anti virus software leads to saving files failing. Provide a way to disable atomic save for debugging purposes. Task-number: QTCREATORBUG-30728 Change-Id: I1f3df009f89f6c27b2e0c9f91869b2a75f5575d8 Reviewed-by: Orgad Shaneh --- src/libs/utils/fileutils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index a2998e2f07d..b3649a457d1 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -197,7 +197,8 @@ FileSaver::FileSaver(const FilePath &filePath, QIODevice::OpenMode mode) m_file.reset(tf); } else { const bool readOnlyOrAppend = mode & (QIODevice::ReadOnly | QIODevice::Append); - m_isSafe = !readOnlyOrAppend && !filePath.hasHardLinks(); + m_isSafe = !readOnlyOrAppend && !filePath.hasHardLinks() + && !qtcEnvironmentVariableIsSet("QTC_DISABLE_ATOMICSAVE"); if (m_isSafe) m_file.reset(new SaveFile(filePath)); else From d717e7be04e48cfb71a389f1cc65186aa40def3c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 24 Apr 2024 14:27:23 +0200 Subject: [PATCH 3/6] TextEditor: fix backspace on block start Amends ec88d279a8d52189685008c8fe46371d13d2505f Change-Id: I7d83b5ffa617f8d45acc6998ce674b1afcf3a31b Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 1d90c7481f2..bea58df3c88 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -6876,7 +6876,8 @@ void TextEditorWidgetPrivate::handleBackspaceKey() } } } else if (typingSettings.m_smartBackspaceBehavior == TypingSettings::BackspaceUnindents) { - if (c.positionInBlock() > TabSettings::firstNonSpace(c.block().text())) { + if (c.positionInBlock() == 0 + || c.positionInBlock() > TabSettings::firstNonSpace(c.block().text())) { if (cursorWithinSnippet) c.beginEditBlock(); c.deletePreviousChar(); From 041727fb29aa16f709fa2046f319401a9604ec33 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 19 Apr 2024 15:36:03 +0200 Subject: [PATCH 4/6] LanguageClient: fix compile with latest Qt dev Change-Id: Ifc6b5cfacb1e4e559646304b4ab5889eeb85bf3f Reviewed-by: hjk --- src/plugins/languageclient/languageclientutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/languageclientutils.cpp b/src/plugins/languageclient/languageclientutils.cpp index 8b9962b6c9b..e92041443cc 100644 --- a/src/plugins/languageclient/languageclientutils.cpp +++ b/src/plugins/languageclient/languageclientutils.cpp @@ -235,8 +235,8 @@ void updateEditorToolBar(Core::IEditor *editor) TextDocument *document = textEditor->textDocument(); Client *client = LanguageClientManager::clientForDocument(textEditor->textDocument()); - ClientExtras *extras = widget->findChild(clientExtrasName, - Qt::FindDirectChildrenOnly); + ClientExtras *extras = dynamic_cast( + widget->findChild(clientExtrasName, Qt::FindDirectChildrenOnly)); if (!extras) { if (!client) return; From 3f46037b373f5b507389f36154fc8ea857645048 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 25 Apr 2024 17:59:50 +0200 Subject: [PATCH 5/6] Debugger: Execute additional attach commands for LLDB This allows setting _Preferences > Debugger > GDB > Additional Attach Commands_ with the content: process handle SIGSEGV --pass true --stop false --notify true which results in the debugger not stopping in assembler for Java runtime exceptions. Task-number: QTCREATORBUG-29928 Change-Id: I8edf0d79dcccfe7ddb27502edb122fb5fb2c646c Reviewed-by: Axel Spoerl Reviewed-by: hjk --- src/plugins/debugger/lldb/lldbengine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 2934f1db440..c6daabd863c 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -30,6 +30,7 @@ #include +#include #include #include #include @@ -328,6 +329,16 @@ void LldbEngine::handleLldbStarted() runEngine(); }; runCommand(cmd3); + + // Execute post attach commands + QStringList commands = settings().gdbPostAttachCommands().split('\n'); + commands = Utils::filtered(commands, [](const QString line) { + const QString trimmed = line.trimmed(); + return !trimmed.isEmpty() && !trimmed.startsWith('#'); + }); + for (const QString &cmd : commands) { + executeDebuggerCommand(cmd); + } } else { notifyEngineSetupFailed(); } From 6b7c6bde5afd87c9152fbe65e041b262c609538f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 25 Apr 2024 14:12:00 +0200 Subject: [PATCH 6/6] QmlJSEditor: Avoid crash on temporary documents Fixes: QTCREATORBUG-30739 Change-Id: I62872fc23529674d5fca6dcb6255872eab12a9da Reviewed-by: David Schulz --- src/plugins/qmljseditor/qmljseditordocument.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 18a9c4d0f26..cef1aefcd2b 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -750,6 +750,9 @@ static Utils::FilePath qmllsForFile(const Utils::FilePath &file, void QmlJSEditorDocumentPrivate::settingsChanged() { + if (q->isTemporary()) + return; + Utils::FilePath newQmlls = qmllsForFile(q->filePath(), ModelManagerInterface::instance()); if (m_qmllsStatus.qmllsPath == newQmlls) return;