qt - QGraphicsRectItem's signal itemChange not generating on drag -


i have made custom class derived qgraphicsrectitem.

class cornerpoint : public qgraphicsrectitem {   public:   cornerpoint(qpointf centre);   enum { type = usertype + 1 };   int type() const{ return type; }  qvariant itemchange(graphicsitemchange change, const qvariant &value);  public slots:  void updateposition(qpointf);  }; 

cpp file

 cornerpoint::cornerpoint(qpointf centre): qgraphicsrectitem(null)  {     setpos(55,22);     setrect(0,0,99,99);  }    qvariant cornerpoint::itemchange(qgraphicsitem::graphicsitemchange change, const qvariant &value) {     std::cout << "change is" << change << std::endl;       if( qgraphicsitem::itempositionchange == change && scene())      {         std::cout << "new values " << value.topointf().x() << value.topointf().y() << std::endl;      }      return qgraphicsitem::itemchange(change, value);  } 

i have made these objects selectable , moveable. when drag them, dont receive signal position change of rectangle. receive signals value 4 (itemselectedchange) , 14 (itemselectedhaschanged).

this post says need enable flags. can't find example of 1 doing this, , using these flags giving errors.

crap.

i had enable flag :

setflag(graphicsitemflag::itemsendsgeometrychanges);


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -