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

QAction::setData always emits dataChanged()

    XMLWordPrintable

Details

    • b0bef01bc1dbfdecf32b56edbafcd4fb0eb2c2e8

    Description

      QAction::setData hasn't check that this data has allready set.

      Look at code. I comment lines which can be added.

      void
      QAction::setData(const QVariant &data)
      {
          Q_D(QAction);
      
      //  if (d->userData == data)
      //      return;
      
          d->userData = data;
          d->sendDataChanged();
      }
      
      

      Or documentation should explain that dataChanged() will always emit.

      At this moment I doubt current behaviour is feature or bug. In my personal case I use this trick to force emit dataChanged when I want it and do not change any data in QAction object.

      Attachments

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

        Activity

          People

            yulong.bai Bai Yulong
            taurus Ivan Romanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes