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

CLONE -QGraphicsItem::itemChange for ItemTransformHasChanged not called, even with QGraphicsItem::ItemSendsGeometryChanges

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • 4.7.0
    • 4.6.3
    • Widgets: GraphicsView
    • None

    Description

      *NOTE: Sorry, I just wanted to reopen the bug (as I was instructed after the previous bug was closed), but I do not see a "reopen" link anywhere. Thus, I've had to clone the original bug twice just to add information. That process might be worthy of a bug report itself....*

      itemChange() is not called when a QGraphicsItem is rotated, even if QGraphicsItem::ItemSendsGeometryChanges is turned on. This is contrary to the documentation. As far as I can tell, there is absolutely no way to receive rotation notifications.

      #include <QtGui>
      
      class Item : public QGraphicsRectItem
      {
      protected:
        virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
        {
          if (change == QGraphicsItem::ItemTransformChange)
            QMessageBox::information(0, "", "TransformChange");
      
          return value;
        }
      };
      
      int main(int argc, char ** argv)
      {
        QApplication app(argc, argv);
      
        QGraphicsScene scene;
        QGraphicsRectItem *item = new Item;
        item->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
        scene.addItem(item);
        item->setTransform(QTransform(2, 0, 0, 2, 0, 0));
        item->setRotation(45);
        return app.exec();
      }
      

      Attachments

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

        Activity

          People

            menard Alexis Menard (closed Nokia identity) (Inactive)
            dmateer Dave Mateer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes