Check if the coordinates are correct and if they are within the item's sceneRect(). Also check if you implemented shape() properly, maybe you're just hitting a transparent area.
Search the forum. I recently posted a verbose explanation of the GV coordinate system.By the way, the help text, at least to me, seems ambiguous when discussing the coordinate systems returned for a QRectF. It isn't clear to me how to obtain coordinates that are consistent with the scene position returned by mouseEvent->scenePos(). It would be most helpful during debugging. I would be grateful for any suggestions on where to look for clarification.
Consider adding a QGraphicsTextItem as a child of the rect item, you might get additional features (like inline editing) for free.Furthermore, on a separate note, a "task" object is a subclass of QGraphicsRectItem (per the example in the book). It requires reimplemening the paint function to add text.
Bookmarks