From 7a0ec64cd882a655bfcdd77876db3746a38b4672 Mon Sep 17 00:00:00 2001 From: Carel Date: Wed, 18 Jun 2025 21:46:25 +0200 Subject: [PATCH 1/5] Update build.yaml for QtC 17 build Build against QtC 17 --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 528eac5..b69cb73 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ on: [push] env: QT_VERSION: "6.6.2" - QT_CREATOR_VERSION: "16.0.0" + QT_CREATOR_VERSION: "17.0.0" QT_MIRRORS: download.qt.io;mirrors.ocf.berkeley.edu/qt;ftp.fau.de/qtproject;mirror.bit.edu.cn/qtproject # The Jobs From 793316d51888c33c905ce88b0c6136b3938e2d73 Mon Sep 17 00:00:00 2001 From: Carel Date: Wed, 18 Jun 2025 21:58:56 +0200 Subject: [PATCH 2/5] Update SpellChecker.json.in for new version --- SpellChecker.json.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpellChecker.json.in b/SpellChecker.json.in index a351a37..a029c89 100644 --- a/SpellChecker.json.in +++ b/SpellChecker.json.in @@ -1,8 +1,8 @@ { "Id" : "spellchecker", "Name" : "SpellChecker", - "Version" : "3.9.0", - "CompatVersion" : "3.9.0", + "Version" : "3.10.0", + "CompatVersion" : "3.10.0", "VendorId" : "carel_combrink", "Vendor" : "Carel Combrink", "Copyright" : "(C) 2015 - 2025 Carel Combrink", From d7f228f89a1b8b10bd3d31013dcafa52280d45cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6llney?= Date: Sun, 29 Jun 2025 15:57:28 +0200 Subject: [PATCH 3/5] Adapted initialize method to new signature Qt Creator 17 has a different signature to the initialize method. I removed the pointer to the error string and fixed the return value type. The return value is changed to Ok (was true before). --- src/spellcheckerplugin.cpp | 5 ++--- src/spellcheckerplugin.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/spellcheckerplugin.cpp b/src/spellcheckerplugin.cpp index b862994..6854b07 100644 --- a/src/spellcheckerplugin.cpp +++ b/src/spellcheckerplugin.cpp @@ -102,7 +102,7 @@ SpellCheckerPlugin::~SpellCheckerPlugin() delete d; } -bool SpellCheckerPlugin::initialize( const QStringList& arguments, QString* errorString ) +Utils::Result<> SpellCheckerPlugin::initialize(const QStringList& arguments) { // Create the core // Load settings @@ -112,7 +112,6 @@ bool SpellCheckerPlugin::initialize( const QStringList& arguments, QString* erro // depends on have initialized their members. Q_UNUSED( arguments ) - Q_UNUSED( errorString ) #ifdef DEBUG_INSTALL_MESSAGE_HANDLER qInstallMessageHandler( myMessageOutput ); #endif /* DEBUG_INSTALL_MESSAGE_HANDLER */ @@ -189,7 +188,7 @@ bool SpellCheckerPlugin::initialize( const QStringList& arguments, QString* erro /* Quick fix provider */ d->quickFixFactory = std::make_unique(); - return true; + return Utils::ResultOk; } void SpellCheckerPlugin::extensionsInitialized() diff --git a/src/spellcheckerplugin.h b/src/spellcheckerplugin.h index b6cee15..8638cfc 100644 --- a/src/spellcheckerplugin.h +++ b/src/spellcheckerplugin.h @@ -47,7 +47,7 @@ class SpellCheckerPlugin SpellCheckerPlugin(); ~SpellCheckerPlugin(); - bool initialize( const QStringList& arguments, QString* errorString ); + Utils::Result<> initialize(const QStringList& arguments); void extensionsInitialized(); ShutdownFlag aboutToShutdown(); private: From c46e105066db7c9fd43ca096cd56155bdc8f5539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6llney?= Date: Mon, 30 Jun 2025 19:50:28 +0200 Subject: [PATCH 4/5] Use override to check for signature changes The virtual initialize(...) method was changed in it's signature by Qt for QtCreator. Because the implementation of the virtual method was not marked override, it was not detected, that his method was not called anymore. This is now changed for the three interface methods. --- src/spellcheckerplugin.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spellcheckerplugin.h b/src/spellcheckerplugin.h index 8638cfc..0ac83c4 100644 --- a/src/spellcheckerplugin.h +++ b/src/spellcheckerplugin.h @@ -47,9 +47,10 @@ class SpellCheckerPlugin SpellCheckerPlugin(); ~SpellCheckerPlugin(); - Utils::Result<> initialize(const QStringList& arguments); - void extensionsInitialized(); - ShutdownFlag aboutToShutdown(); + Utils::Result<> initialize(const QStringList& arguments) override; + void extensionsInitialized() override; + ShutdownFlag aboutToShutdown() override; + private: SpellCheckerPluginPrivate* const d; }; From d3cbb4e4ae1aacfcd590dac51d51d6f0607cde1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6llney?= Date: Tue, 1 Jul 2025 19:15:10 +0200 Subject: [PATCH 5/5] Editor->widget has type TextEditor::TextEditorWidget The connection to the signal cursorPositionChanged was failing, because the editor widget type changed to TextEditor::TextEditorWidget. The qdynamic_cast delivered a null pointer, so that changes of the cursor were not processed anymore. --- src/spellcheckercore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spellcheckercore.cpp b/src/spellcheckercore.cpp index 706087b..25132b0 100644 --- a/src/spellcheckercore.cpp +++ b/src/spellcheckercore.cpp @@ -797,7 +797,8 @@ void SpellCheckerCore::editorOpened( Core::IEditor* editor ) if( editor == nullptr ) { return; } - connect( qobject_cast( editor->widget() ), &QPlainTextEdit::cursorPositionChanged, this, &SpellCheckerCore::cursorPositionChanged ); + TextEditor::TextEditorWidget* tew = qobject_cast(editor->widget()); + connect( tew, &TextEditor::TextEditorWidget::cursorPositionChanged, this, &SpellCheckerCore::cursorPositionChanged ); } // -------------------------------------------------- @@ -806,7 +807,8 @@ void SpellCheckerCore::editorAboutToClose( Core::IEditor* editor ) if( editor == nullptr ) { return; } - disconnect( qobject_cast( editor->widget() ), &QPlainTextEdit::cursorPositionChanged, this, &SpellCheckerCore::cursorPositionChanged ); + TextEditor::TextEditorWidget* tew = qobject_cast(editor->widget()); + disconnect( tew, &TextEditor::TextEditorWidget::cursorPositionChanged, this, &SpellCheckerCore::cursorPositionChanged ); } // --------------------------------------------------