QKeyMapper: Merge default implementation of possibleKeys into call site
Task-number: QTBUG-116873 Change-Id: I9091f4a9d465fb928afcabce0536fcd2d03b7f82 Reviewed-by: Andrey Butirsky <butirsky@gmail.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
f58df04196
commit
96e762e5a4
@ -35,16 +35,6 @@ QKeyMapper::~QKeyMapper()
|
||||
{
|
||||
}
|
||||
|
||||
static QList<int> extractKeyFromEvent(QKeyEvent *e)
|
||||
{
|
||||
QList<int> 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;
|
||||
}
|
||||
|
||||
QList<int> QKeyMapper::possibleKeys(QKeyEvent *e)
|
||||
{
|
||||
return instance()->d_func()->possibleKeys(e);
|
||||
@ -96,7 +86,11 @@ QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
|
||||
if (!result.isEmpty())
|
||||
return result;
|
||||
|
||||
return extractKeyFromEvent(e);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user