Getting Back on Track

Today we finally got an answer to our query on how to work with QGraphicsScene and QGraphicsItems.

We asked around on IRC and ML but didn’t get a reply. So we posted our query along with code of our demo application on Qt’s forum.

And at last somebody replied and pointed our mistake.

We were creating a scene directly in our mainwindow and each entity has its own mouse events associated with it like mousepress, mousemove, etc. and the paint event was also defined here.

But we have to handle events in the scene and not in the item. Only painting is to be done in item class. So now we have separate graphicsscene class which will handle the events.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s