Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qevdevutil.cpp
Go to the documentation of this file.
1
// Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
include
"qevdevutil_p.h"
5
6
QT_BEGIN_NAMESPACE
7
8
using
namespace
Qt::StringLiterals;
9
10
namespace
QEvdevUtil
{
11
12
ParsedSpecification
parseSpecification
(
const
QString &specification)
13
{
14
ParsedSpecification
result;
15
16
result.args = QStringView{specification}.split(u':');
17
18
for
(
const
auto
&arg : std::as_const(result.args)) {
19
if
(arg.startsWith(
"/dev/"_L1
)) {
20
// if device is specified try to use it
21
result.devices.append(arg.toString());
22
#
ifdef
Q_OS_VXWORKS
23
}
else
if
(arg.startsWith(
"/input/"_L1
)) {
24
result.devices.append(arg.toString());
25
#
endif
26
}
else
{
27
// build new specification without /dev/ elements
28
result.spec += arg + u':';
29
}
30
}
31
32
if
(!result.spec.isEmpty())
33
result.spec.chop(1);
// remove trailing ':'
34
35
return
result;
36
}
37
38
}
// namespace QEvdevUtil
39
40
QT_END_NAMESPACE
QEvdevUtil
Definition
qevdevutil.cpp:10
QEvdevUtil::parseSpecification
ParsedSpecification parseSpecification(const QString &specification)
Definition
qevdevutil.cpp:12
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QEvdevUtil::ParsedSpecification
Definition
qevdevutil_p.h:29
qtbase
src
platformsupport
input
shared
qevdevutil.cpp
Generated on
for Qt by
1.18.0