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

QGraphicsScene always in inactive state if placed in a QTabWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.9.0 FF
    • 5.6.1
    • Widgets: GraphicsView
    • None
    • Ubuntu 16.04 64bit
    • f27534158 (dev), da9da78ad (6.8), b17703171 (dev), 0f46d3fa7 (6.7)

    Description

      1. Create QTabWidget
      2. Add two tabs - with QGraphicsView and empty.
      3. Hide the QTabWidget, the QGraphicsView will receives QEvent::Hide and send event to a QGraphicsScene:

      case QEvent::Hide:
      // spontaneous event will generate a WindowDeactivate.
      if (!event->spontaneous() && d->scene && isActiveWindow())

      { QEvent windowDeactivate(QEvent::WindowDeactivate); QApplication::sendEvent(d->scene, &windowDeactivate); }

      break;

      ....

      case QEvent::WindowDeactivate:
      if (!-d>activationRefCount) {

      Here activationRefCount will equal to 0.

      4. Change current tab from scene to another. QGraphicsView will receives QEvent::Hide again. So activationRefCount will equal to -1.
      5. Make QTabWidget visible.
      6. Switch to tab with the QGraphicsView - it will receives QEvent::Show event and activationRefCount will equal to 0. But that's wrong - because we have active tab with the scene.

      Please see screencast: https://www.youtube.com/watch?v=dU3eG94XUQ8

      (sorry for my English).

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            igornikitin Igor
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes