summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qitemdelegate.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-04-22 18:14:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 12:32:47 +0200
commit3b992f8319b673495ffc74c65ed6a6761e88913c (patch)
tree85080d6160b246ef50ff1e9f3466c13617b74ee1 /src/widgets/itemviews/qitemdelegate.cpp
parent7dd81686e8e9ee86624c5bcca10688cfb360dcb8 (diff)
Enforce focus policy in item delegate's editor
Focus policy can be wider in this case given the limited scope of the editor widget. This helps workaround platform specific focus policies, like on Mac, were focus can be restricted depending on the widget type. Task-number: QTBUG-30715 Change-Id: I69acf8ebff4ba16d473964c91680a1cb0235e3cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qitemdelegate.cpp')
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index f2c3c4702f..7d8512adc4 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -523,7 +523,10 @@ QWidget *QItemDelegate::createEditor(QWidget *parent,
const QItemEditorFactory *factory = d->f;
if (factory == 0)
factory = QItemEditorFactory::defaultFactory();
- return factory->createEditor(index.data(Qt::EditRole).userType(), parent);
+ QWidget *w = factory->createEditor(index.data(Qt::EditRole).userType(), parent);
+ if (w)
+ w->setFocusPolicy(Qt::WheelFocus);
+ return w;
}
/*!