Hi,
I'm trying to have a QGraphicsTextItem on my scene, movable and editable. The desired behavior is: double click (select text and edit it), drag and drop. Like a normal text in any application, but being able to move it around.
I though that was possible with the next code, but the text doesn't change (is selected, I can copy and paste but nothing is written from the keyboard) and, when I set the text interaction flag, the item is not movable.
textItem ->setTextInteractionFlags(Qt::TextEditorInteraction);
textItem ->setPos(100, 200);
m_pMyScene->addItem(textItem);
QGraphicsTextItem* textItem = new QGraphicsTextItem("test item");
textItem ->setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsMovable);
textItem ->setTextInteractionFlags(Qt::TextEditorInteraction);
textItem ->setPos(100, 200);
m_pMyScene->addItem(textItem);
To copy to clipboard, switch view to plain text mode
what could be wrong? thanks!
Bookmarks