summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-24 14:29:37 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-24 14:31:53 (GMT)
commit1e36e3917cae1e6b55cce46dc7e0e8a0b336cd01 (patch)
treef8491ca132c987fcf79ae265a1d0be56232cddbe /src/gui/widgets
parent6bf1037df75d8d6f697f9f49d8d7fbe9b2cabc98 (diff)
downloadQt-1e36e3917cae1e6b55cce46dc7e0e8a0b336cd01.zip
Qt-1e36e3917cae1e6b55cce46dc7e0e8a0b336cd01.tar.gz
Qt-1e36e3917cae1e6b55cce46dc7e0e8a0b336cd01.tar.bz2
Make paste + undo behave in QLineEdit as it does in QTextEdit
On the undo/redo stack, it needs to be treated as a separate command Task-number: QTBUG-5786 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 300a2ea..334a925 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -138,7 +138,12 @@ void QLineControl::copy(QClipboard::Mode mode) const
*/
void QLineControl::paste()
{
- insert(QApplication::clipboard()->text(QClipboard::Clipboard));
+ QString clip = QApplication::clipboard()->text(QClipboard::Clipboard);
+ if (!clip.isEmpty() || hasSelectedText()) {
+ separate(); //make it a separate undo/redo command
+ insert(clip);
+ separate();
+ }
}
#endif // !QT_NO_CLIPBOARD