commit 6a835bb11e40c57f28e78ff7ffff56deb0390c4d
Author: Koji Yokota <[email protected]>
Date:   Wed Jul 23 02:07:04 2025 +0900

    Add support for Qt::ImPreferredLanguage query
---
 src/frontends/qt/GuiInputMethod.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/frontends/qt/GuiInputMethod.cpp 
b/src/frontends/qt/GuiInputMethod.cpp
index 7981b74eae..71a38b0680 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -24,9 +24,7 @@
 #include "GuiWorkArea.h"
 #include "InsetList.h"
 #include "KeyMap.h"
-#if defined(Q_OS_WIN) || defined (Q_CYGWIN_WIN) || defined (Q_OS_LINUX)
 #include "Language.h"
-#endif
 #include "LyX.h"
 #include "LyXRC.h"
 #include "Row.h"
@@ -962,6 +960,14 @@ void GuiInputMethod::processQuery(Qt::InputMethodQuery 
query)
                Q_EMIT 
queryProcessed((qlonglong)d->work_area_->inputMethodHints());
                break;
        }
+       //
+       case Qt::ImPreferredLanguage: {
+               QLocale locale(toqstr(d->cur_->getFont().language()->code()));
+               QString lang = locale.languageToString(locale.language());
+               LYXERR(Debug::DEBUG, msg << lang);
+               Q_EMIT queryProcessed(lang);
+               break;
+       }
        // Qt::ImAnchorRectangle holds the selection rectangle in preedit.
        // it seems this property is not yet used by most of input methods
        // as of August 2024.
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to