Hello,
I can't edit a QGraphicsTextItem. Only the tab key work, other keys don't work.
So, i create my scene here:
{
ui.setupUi(this);
ui.graphicsView->setScene(m_pScene);
}
uml::uml(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
m_pScene = new QGraphicsScene;
ui.graphicsView->setScene(m_pScene);
}
To copy to clipboard, switch view to plain text mode
And my QGraphicsTextItem:
QTextEdit* text
= widget
->findChild<QTextEdit
*>
("text");
QString strText
= methodes
->toPlainText
();
classeText ->setTextInteractionFlags(Qt::TextEditorInteraction);
QTextEdit* text= widget->findChild<QTextEdit*>("text");
QString strText = methodes->toPlainText();
QGraphicsTextItem* classeText = new QGraphicsTextItem(strText );
classeText ->setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsMovable);
classeText ->setTextInteractionFlags(Qt::TextEditorInteraction);
To copy to clipboard, switch view to plain text mode
With this thing, don't work. How to do for change texte of one of this ?
Bookmarks