Menu
  • HOME
  • TAGS

QGraphicsTextItem editing requires an action performed twice

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(); } ...

Cannot implement Drag and Drop for TextItem

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...

Text field keeping track of count in QT using QGraphicsScene

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...

How can I display unicode in QGraphicsTextItem? [duplicate]

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....