Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42915

Infinite loop in QGraphicsScene::focusNextPrevChild

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.8.0 Alpha
    • 5.3.2
    • Widgets: GraphicsView
    • None
    • Debian 7 amd64

      If nothing has focus in a graphics scene, and that scene contains a panel whose first child does not accept tab focus, then pressing tab will cause the application to hang.

      I've attached an test app that demonstrates the issue. Once the app starts, pressing tab will cause it to freeze.

      The problem is this loop in QGraphicsScene::focusNextPrevChild that does not change 'fw' and so will never terminate:

      QGraphicsWidget *fw = static_cast<QGraphicsWidget *>(d->activePanel)->d_func()->focusNext;
      do {
          if (fw->focusPolicy() & Qt::TabFocus) {
              setFocusItem(fw, next ? Qt::TabFocusReason : Qt::BacktabFocusReason);
              return true;
          }
      } while (fw != d->activePanel);
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            iamsergio Sergio Martins
            phorrocks89 Peter Horrocks
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes