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

Infinite loop in QGraphicsScene::focusNextPrevChild

    XMLWordPrintable

Details

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

    Description

      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);
      

      Attachments

        For Gerrit Dashboard: QTBUG-42915
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes