Skip to content

Commit 3311b88

Browse files
authored
Merge pull request #1248 from deXol/develop
Fix build issue for Keyboard Layout Detector <6.0 Qt version
2 parents 5c2cf87 + 94990a2 commit 3311b88

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/utils/KeyboardLayoutDetectorUnix.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,18 @@ QString KeyboardLayoutDetectorUnix::getKeyboardLayout()
7474
if (!out.isEmpty())
7575
{
7676
const RegExp rx(RESULT_REGEXP);
77+
#if QT_VERSION < 0x060000
78+
if (rx.indexIn(out) != -1)
79+
{
80+
return rx.cap(1);
81+
}
82+
#else
7783
auto match = rx.match(out);
7884
if (match.hasMatch())
7985
{
8086
return match.captured(1);
8187
}
88+
#endif
8289
}
8390

8491
qWarning() << "Keyboard layout was not fetched successfully";

0 commit comments

Comments
 (0)