From bffceb18e79fa82fbaa674c814afd5c2612bcdaf Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 19 Dec 2013 18:56:43 -0200 Subject: Do not New / Delete the item, use the Stack. This should be somewhat faster, and the code is cleaner. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/tagwidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index 494a473d0..7ec0472ea 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -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); } -- cgit v1.2.3-70-g09d2