gui-apps/input-leap: fix build w/ qt-6.9

Closes: https://bugs.gentoo.org/958396
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2025-06-28 04:59:47 +01:00
parent d92f25030a
commit e3f3c6aa09
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,40 @@
https://bugs.gentoo.org/958396
https://github.com/input-leap/input-leap/issues/2221
https://github.com/input-leap/input-leap/pull/2232
From d5c08a2ac8398f5ee6a1b2032e791d5980c47d60 Mon Sep 17 00:00:00 2001
From: Dom Rodriguez <shymega@shymega.org.uk>
Date: Wed, 23 Apr 2025 13:35:11 +0100
Subject: [PATCH] fix(gui): Adjust KeySequence.cpp for Qt > 6.9 change
Based off these comments on #2231.
- https://github.com/input-leap/input-leap/pull/2231#issuecomment-2823052026
- https://github.com/input-leap/input-leap/pull/2231#issuecomment-2824062717
And this patch: https://gist.github.com/sid-code/9131300ee943af1ce5958ee40e527b93
Closes: #2231.
Closes: #2221.
---
src/gui/src/KeySequence.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gui/src/KeySequence.cpp b/src/gui/src/KeySequence.cpp
index 06a8efcd5..8e1012345 100644
--- a/src/gui/src/KeySequence.cpp
+++ b/src/gui/src/KeySequence.cpp
@@ -237,8 +237,11 @@ QString KeySequence::keyToString(int key)
// representable in ucs2?
if (key < 0x10000)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
+ return QString("\\u%1").arg((uint16_t) QChar(key).toLower().unicode(), 4, 16, QChar('0'));
+#else
return QString("\\u%1").arg(QChar(key).toLower().unicode(), 4, 16, QChar('0'));
-
+#endif
// give up, InputLeap probably won't handle this
return "";
}

View File

@ -61,6 +61,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${P}-gui-crash.patch
"${DISTDIR}"/${P}-no-x11.patch
"${FILESDIR}"/${P}-qt-6.9.patch
)
DOCS=(