From 561661b476c2982054e9d84e0d240f4e86721d9f Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:20:19 +0200 Subject: [PATCH] fix: Compatibility problem with nvenc on windows * change default chat render to software on windows --- qodeassist.cpp | 12 ++++++++---- settings/ChatAssistantSettings.cpp | 12 ++++++++++++ settings/ChatAssistantSettings.hpp | 2 ++ settings/SettingsConstants.hpp | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/qodeassist.cpp b/qodeassist.cpp index dc3b7c7..91491c0 100644 --- a/qodeassist.cpp +++ b/qodeassist.cpp @@ -120,6 +120,9 @@ public: Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY, ":/resources/images/qoderassist-icon.png"); #endif + QQuickWindow::setSceneGraphBackend( + Settings::chatAssistantSettings().chatRenderer.stringValue()); + loadTranslations(); Providers::registerProviders(); @@ -202,12 +205,13 @@ public: showChatViewAction.setText(Tr::tr("Show QodeAssist Chat")); showChatViewAction.setIcon(QCODEASSIST_CHAT_ICON.icon()); showChatViewAction.addOnTriggered(this, [this] { + if (!m_chatView) { + m_chatView.reset(new Chat::ChatView()); + } + if (!m_chatView->isVisible()) { m_chatView->show(); } - - m_chatView->raise(); - m_chatView->requestActivate(); }); m_statusWidget->setChatButtonAction(showChatViewAction.contextAction()); @@ -237,7 +241,7 @@ public: } } - void extensionsInitialized() final { m_chatView.reset(new Chat::ChatView()); } + void extensionsInitialized() final {} void restartClient() { diff --git a/settings/ChatAssistantSettings.cpp b/settings/ChatAssistantSettings.cpp index c07ec75..f0330c0 100644 --- a/settings/ChatAssistantSettings.cpp +++ b/settings/ChatAssistantSettings.cpp @@ -206,6 +206,17 @@ ChatAssistantSettings::ChatAssistantSettings() textFormat.addOption("HTML"); textFormat.addOption("Plain Text"); + chatRenderer.setSettingsKey(Constants::CA_CHAT_RENDERER); + chatRenderer.setLabelText(Tr::tr("Chat Renderer:")); + chatRenderer.addOption("rhi"); + chatRenderer.addOption("software"); + chatRenderer.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox); +#ifdef Q_OS_WIN + chatRenderer.setDefaultValue("software"); +#else + chatRenderer.setDefaultValue("rhi"); +#endif + resetToDefaults.m_buttonText = TrConstants::RESET_TO_DEFAULTS; readSettings(); @@ -233,6 +244,7 @@ ChatAssistantSettings::ChatAssistantSettings() chatViewSettingsGrid.addRow({textFontFamily, textFontSize}); chatViewSettingsGrid.addRow({codeFontFamily, codeFontSize}); chatViewSettingsGrid.addRow({textFormat}); + chatViewSettingsGrid.addRow({chatRenderer}); return Column{Row{Stretch{1}, resetToDefaults}, Space{8}, diff --git a/settings/ChatAssistantSettings.hpp b/settings/ChatAssistantSettings.hpp index c34412b..0ddec36 100644 --- a/settings/ChatAssistantSettings.hpp +++ b/settings/ChatAssistantSettings.hpp @@ -72,6 +72,8 @@ public: Utils::IntegerAspect codeFontSize{this}; Utils::SelectionAspect textFormat{this}; + Utils::SelectionAspect chatRenderer{this}; + private: void setupConnections(); void resetSettingsToDefaults(); diff --git a/settings/SettingsConstants.hpp b/settings/SettingsConstants.hpp index 354138e..6f4618f 100644 --- a/settings/SettingsConstants.hpp +++ b/settings/SettingsConstants.hpp @@ -167,5 +167,6 @@ const char CA_TEXT_FONT_SIZE[] = "QodeAssist.caTextFontSize"; const char CA_CODE_FONT_FAMILY[] = "QodeAssist.caCodeFontFamily"; const char CA_CODE_FONT_SIZE[] = "QodeAssist.caCodeFontSize"; const char CA_TEXT_FORMAT[] = "QodeAssist.caTextFormat"; +const char CA_CHAT_RENDERER[] = "QodeAssist.caChatRenderer"; } // namespace QodeAssist::Constants