Do not New / Delete the item, use the Stack.
This should be somewhat faster, and the code is cleaner. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2ead1ebe08
commit
bffceb18e7
@ -183,9 +183,8 @@ void TagWidget::keyPressEvent(QKeyEvent *e) {
|
||||
}
|
||||
}
|
||||
if (e->key() == Qt::Key_Tab) { // let's pretend this is a comma instead
|
||||
QKeyEvent *fakeEvent = new QKeyEvent(e->type(), Qt::Key_Comma, e->modifiers(), QString(","));
|
||||
GroupedLineEdit::keyPressEvent(fakeEvent);
|
||||
delete fakeEvent;
|
||||
QKeyEvent fakeEvent(e->type(), Qt::Key_Comma, e->modifiers(), QString(","));
|
||||
GroupedLineEdit::keyPressEvent(&fakeEvent);
|
||||
} else {
|
||||
GroupedLineEdit::keyPressEvent(e);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user