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

Calling QGraphicsItem::setActive(false) for inactive item activates last panel

    XMLWordPrintable

Details

    Description

      Calling setActive(false) for an item that is not active will change the current active panel for no reason:

      void QGraphicsItem::setActive(bool active)
      {
          d_ptr->explicitActivate = 1;
          d_ptr->wantsActive = active;
          if (d_ptr->scene) {
              if (active) {
                  // Activate this item.
                  d_ptr->scene->setActivePanel(this);
              } else {
                  // Deactivate this item, and reactivate the last active item
                  // (if any).
                  QGraphicsItem *lastActive = d_ptr->scene->d_func()->lastActivePanel;  
                  d_ptr->scene->setActivePanel(lastActive != this ? lastActive : 0);  // <<<<<<------ assumes this item was active
              }
          }
      }
      

      Attachments

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

        Activity

          People

            ylopes Yoann Lopes
            mikkohar Mikko Harju
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes