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

Qt4.4.0: Bug with WA_UpdatesDisabled vs. WA_ForceUpdatesDisabled and QAbstractItemView

    XMLWordPrintable

Details

    Description

      QWidget.cpp:
      void QWidget::setUpdatesEnabled(bool enable)

      { Q_D(QWidget); setAttribute(Qt::WA_ForceUpdatesDisabled, !enable); // Here the "Force"-Flag is set d->setUpdatesEnabled_helper(enable); } QWidget.h: inline bool QWidget::updatesEnabled() const { return !testAttribute(Qt::WA_UpdatesDisabled); }

      // UpdatesDisabled
      without "Force".

      Problem:
      void QAbstractItemView::mousePressEvent(QMouseEvent *event)
      {
      ...
      bool updates = d->viewport->updatesEnabled(); // Test flag without
      "Force"
      d->viewport->setUpdatesEnabled(command ==
      QItemSelectionModel::NoUpdate);
      d->selectionModel->setCurrentIndex(index,
      QItemSelectionModel::NoUpdate);
      d->viewport->setUpdatesEnabled(updates); // Set flag with "Force"
      ...
      }

      This works only if the updates were not disabled before testing.

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            ebaak Ed Baak (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes