gui: add QInputDevice::seatNames()
Change-Id: Ie6cedd62dcd684a8fd9adbc2409e5aa1f3490ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
0e72a846d3
commit
143f20692e
@ -280,6 +280,25 @@ QList<const QInputDevice *> QInputDevice::devices()
|
||||
return *deviceList();
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 6.3
|
||||
|
||||
Returns a list of seat names for all registered input devices (keyboards and pointing devices).
|
||||
*/
|
||||
QStringList QInputDevice::seatNames()
|
||||
{
|
||||
QMutexLocker locker(&devicesMutex);
|
||||
const InputDevicesList devices = *deviceList();
|
||||
locker.unlock();
|
||||
QStringList result;
|
||||
for (const QInputDevice *d : devices) {
|
||||
if (!result.contains(d->seatName()))
|
||||
result.append(d->seatName());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the core or master keyboard on the given seat \a seatName.
|
||||
*/
|
||||
|
@ -110,6 +110,7 @@ public:
|
||||
QString seatName() const;
|
||||
QRect availableVirtualGeometry() const;
|
||||
|
||||
static QStringList seatNames();
|
||||
static QList<const QInputDevice *> devices();
|
||||
static const QInputDevice *primaryKeyboard(const QString& seatName = QString());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user