QLineEdit: Create a separate undo entry for each middle-click paste

Previously, a sequence of middle-click pastes produced just one undo
item to undo/redo all of the pastes at once.
The new code seems to be the intended way to paste the selection anyway.

Change-Id: Ifc2e9714628da9e394053ff8c34709578656f54d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Andreas Hartmetz 2016-01-17 01:05:07 +01:00 committed by Andreas Hartmetz
parent 2e1ad4335c
commit 90749ecf09

View File

@ -1582,7 +1582,7 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e)
d->control->copy(QClipboard::Selection);
} else if (!d->control->isReadOnly() && e->button() == Qt::MidButton) {
deselect();
insert(QApplication::clipboard()->text(QClipboard::Selection));
d->control->paste(QClipboard::Selection);
}
}
#endif