Set StrongFocus on QQuickWidget
Make text input functional out of the box. Both QGraphicsView and QDeclarativeView (QQuick1) do this so there is no reason to do this differently for QQuickWidget. For QQuickWindow and QQuickView the issue does not exist in the first place, they will accept the focus by default. Task-number: QTBUG-39605 Change-Id: I74f01b85342df51aa3c0e80baf58ba1619c63438 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This commit is contained in:
parent
193cdf2a34
commit
6bb3b94193
|
@ -310,6 +310,7 @@ QQuickWidget::QQuickWidget(QWidget *parent)
|
|||
: QWidget(*(new QQuickWidgetPrivate), parent, 0)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
d_func()->init();
|
||||
}
|
||||
|
||||
|
@ -322,6 +323,7 @@ QQuickWidget::QQuickWidget(const QUrl &source, QWidget *parent)
|
|||
: QWidget(*(new QQuickWidgetPrivate), parent, 0)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
d_func()->init();
|
||||
setSource(source);
|
||||
}
|
||||
|
@ -339,6 +341,7 @@ QQuickWidget::QQuickWidget(QQmlEngine* engine, QWidget *parent)
|
|||
: QWidget(*(new QQuickWidgetPrivate), parent, 0)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
Q_ASSERT(engine);
|
||||
d_func()->init(engine);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue