--- a/src/gui/widgets/qlineedit.cpp Fri May 14 16:40:13 2010 +0300
+++ b/src/gui/widgets/qlineedit.cpp Thu May 27 13:40:48 2010 +0300
@@ -738,8 +738,14 @@
setText(oldText);
return false;
}
- setCursorPosition(newPos);
- setSelection(qMin(newMarkAnchor, newMarkDrag), qAbs(newMarkAnchor - newMarkDrag));
+ int selstart = qMin(newMarkAnchor, newMarkDrag);
+ int sellength = qAbs(newMarkAnchor - newMarkDrag);
+ if (selstart == newPos) {
+ selstart = qMax(newMarkAnchor, newMarkDrag);
+ sellength = -sellength;
+ }
+ //setSelection also set the position
+ setSelection(selstart, sellength);
return true;
}
#endif //QT3_SUPPORT