c++,qt,text,editing,qgraphicstextitem
I expected a mouse action on a focusable item to give it focus automatically. I guess not... In the mouseDoubleClickEvent, I added a call to setFocus() virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event) { Q_UNUSED(event); setTextInteractionFlags(Qt::TextEditorInteraction); setFocus(); } ...
qt,drag-and-drop,qgraphicsitem,qgraphicstextitem
The error message is telling you that there is a forward declaration somewhere in your code, although that is not true based on the code you have shown so far. Either way, for accessingt members of your heap object, you need more than just forward declaration. You are missing this...
c++,qt,qgraphicsscene,qgraphicstextitem
You could subclass QGraphicsObject instead of QGraphicsItem, that would allow you to use signals from within the Person class. Then just emit a signal to a slot that counts the items and changes the text of text1. What I would do is move your graphics view to a new QWidget...
qt,unicode,qgraphicsitem,qgraphicstextitem
I think you should use the QGraphicsTextItem item. item.setHtml( "Café Frapé" ); function instead of the mentioned. Read this QGraphicsTextItem::setHtml....