QKeyMapper: Remove indirection via QKeyMapperPrivate for possibleKeys
Change-Id: I1988ac60689b3e6f4b29e38d1167d2b998702c09 Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
96e762e5a4
commit
953e7eece8
@ -37,7 +37,15 @@ QKeyMapper::~QKeyMapper()
|
||||
|
||||
QList<int> QKeyMapper::possibleKeys(QKeyEvent *e)
|
||||
{
|
||||
return instance()->d_func()->possibleKeys(e);
|
||||
QList<int> result = QGuiApplicationPrivate::platformIntegration()->possibleKeys(e);
|
||||
if (!result.isEmpty())
|
||||
return result;
|
||||
|
||||
if (e->key() && (e->key() != Qt::Key_unknown))
|
||||
result << e->keyCombination().toCombined();
|
||||
else if (!e->text().isEmpty())
|
||||
result << int(e->text().at(0).unicode() + (int)e->modifiers());
|
||||
return result;
|
||||
}
|
||||
|
||||
extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event); // in qapplication_*.cpp
|
||||
@ -80,19 +88,6 @@ QKeyMapperPrivate::~QKeyMapperPrivate()
|
||||
{
|
||||
}
|
||||
|
||||
QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
|
||||
{
|
||||
QList<int> result = QGuiApplicationPrivate::platformIntegration()->possibleKeys(e);
|
||||
if (!result.isEmpty())
|
||||
return result;
|
||||
|
||||
if (e->key() && (e->key() != Qt::Key_unknown))
|
||||
result << e->keyCombination().toCombined();
|
||||
else if (!e->text().isEmpty())
|
||||
result << int(e->text().at(0).unicode() + (int)e->modifiers());
|
||||
return result;
|
||||
}
|
||||
|
||||
void *QKeyMapper::resolveInterface(const char *name, int revision) const
|
||||
{
|
||||
Q_UNUSED(name); Q_UNUSED(revision);
|
||||
|
@ -55,8 +55,6 @@ public:
|
||||
QKeyMapperPrivate();
|
||||
~QKeyMapperPrivate();
|
||||
|
||||
QList<int> possibleKeys(QKeyEvent *e);
|
||||
|
||||
QLocale keyboardInputLocale;
|
||||
Qt::LayoutDirection keyboardInputDirection;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user