summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.qdoc3
-rw-r--r--src/corelib/tools/qstring.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index e8d6df0..5f9d01d 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2841,6 +2841,9 @@
\value WidgetGesture Gestures can only start over the widget itself.
\value WidgetWithChildrenGesture Gestures can start on the widget or over
any of its children.
+ \value ItemGesture Gestures can only start over the item itself.
+ \value ItemWithChildrenGesture Gestures can start on the item or over
+ any of its children.
\sa QWidget::grabGesture()
*/
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index a996f30..55ad28d 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1590,12 +1590,12 @@ QString &QString::append(QChar ch)
*/
QString &QString::remove(int pos, int len)
{
- if (pos < 0)
+ if (pos < 0) // count from end of string
pos += d->size;
if (pos < 0 || pos >= d->size) {
// range problems
- } else if (pos + len >= d->size) { // pos ok
- resize(pos);
+ } else if (len >= d->size - pos) {
+ resize(pos); // truncate
} else if (len > 0) {
detach();
memmove(d->data + pos, d->data + pos + len,