summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_s60.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-11-11 13:34:15 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-11-11 13:36:02 (GMT)
commit258e751b7f4c3ff5e44fdbd654ce45d0693934bf (patch)
tree4074f6d15090f5910fb60d6b63f4bab467a25b76 /src/gui/kernel/qwidget_s60.cpp
parent72c170b64056a59dce9f849a5789d2968071f7b9 (diff)
downloadQt-258e751b7f4c3ff5e44fdbd654ce45d0693934bf.zip
Qt-258e751b7f4c3ff5e44fdbd654ce45d0693934bf.tar.gz
Qt-258e751b7f4c3ff5e44fdbd654ce45d0693934bf.tar.bz2
Fix for assertion failure in in QWidget::grabMouse for Symbian.
Docs say: "Note that only visible widgets can grab mouse input. If isVisible() returns false for a widget, that widget cannot call grabMouse()." qwidget_x11.cpp uses the similar condition in grabMouse as symbian after this commit. Task-number: QTBUG-5658 Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 915d308..504a538 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1236,7 +1236,7 @@ void QWidget::releaseKeyboard()
void QWidget::grabMouse()
{
- if (!qt_nograb()) {
+ if (isVisible() && !qt_nograb()) {
if (QWidgetPrivate::mouseGrabber && QWidgetPrivate::mouseGrabber != this)
QWidgetPrivate::mouseGrabber->releaseMouse();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
@@ -1253,7 +1253,7 @@ void QWidget::grabMouse()
#ifndef QT_NO_CURSOR
void QWidget::grabMouse(const QCursor &cursor)
{
- if (!qt_nograb()) {
+ if (isVisible() && !qt_nograb()) {
if (QWidgetPrivate::mouseGrabber && QWidgetPrivate::mouseGrabber != this)
QWidgetPrivate::mouseGrabber->releaseMouse();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));