diff options
author | João de Deus Morgado <joao.deusmorgado@kdab.com> | 2015-06-11 07:40:31 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-07 08:44:34 +0000 |
commit | 1f8a2ff41da88c6a87d6b6509b6db2b22a70e28d (patch) | |
tree | 05cdf08f8d1fa7257aa586dc9a240c48d5d87e07 /src/widgets | |
parent | 87c426d5f428660b2af98a10e88f6b68a60bd59d (diff) |
Fix Infinite loop in QGraphicsScene::focusNextPrevChild
Task-number: QTBUG-42915
Change-Id: Ie380e0d77453bcdb68e92dcffe8278f169da27bc
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 7b67f332e1..da5c2849ae 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -5430,12 +5430,14 @@ bool QGraphicsScene::focusNextPrevChild(bool next) return true; } if (d->activePanel->isWidget()) { - QGraphicsWidget *fw = static_cast<QGraphicsWidget *>(d->activePanel)->d_func()->focusNext; + QGraphicsWidget *test = static_cast<QGraphicsWidget *>(d->activePanel); + QGraphicsWidget *fw = next ? test->d_func()->focusNext : test->d_func()->focusPrev; do { if (fw->focusPolicy() & Qt::TabFocus) { setFocusItem(fw, next ? Qt::TabFocusReason : Qt::BacktabFocusReason); return true; } + fw = next ? fw->d_func()->focusNext : fw->d_func()->focusPrev; } while (fw != d->activePanel); } } |