summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-09 17:14:52 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-17 14:47:54 (GMT)
commit77230f7ec9e78ec2d57629ea934ceb1d59eb391e (patch)
tree87ce66625cc5d5ed0ff3271f8674f11efae3ddb7 /src/gui/itemviews/qabstractitemview.cpp
parent90dfb5e5d8fc8cb841b0762cd88aa4b996c38312 (diff)
downloadQt-77230f7ec9e78ec2d57629ea934ceb1d59eb391e.zip
Qt-77230f7ec9e78ec2d57629ea934ceb1d59eb391e.tar.gz
Qt-77230f7ec9e78ec2d57629ea934ceb1d59eb391e.tar.bz2
Do not beep on Mac when pressing some keys.
When a key event is delivered to widgets, we should accept the event if the widget reacted to it in any way - if either the current item has changed or if the widget scrolled. Task-number: QTBUG-6444 Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 3738816..fc53ea3 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -104,7 +104,8 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate()
horizontalScrollMode(QAbstractItemView::ScrollPerItem),
currentIndexSet(false),
wrapItemText(false),
- delayedPendingLayout(false)
+ delayedPendingLayout(false),
+ moveCursorUpdatedView(false)
{
}
@@ -2210,6 +2211,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
#endif
QPersistentModelIndex newCurrent;
+ d->moveCursorUpdatedView = false;
switch (event->key()) {
case Qt::Key_Down:
newCurrent = moveCursor(MoveDown, event->modifiers());
@@ -2266,6 +2268,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
QRect rect(d->pressedPosition - d->offset(), QSize(1, 1));
setSelection(rect, command);
}
+ event->accept();
return;
}
}
@@ -2363,6 +2366,8 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
}
break; }
}
+ if (d->moveCursorUpdatedView)
+ event->accept();
}
/*!