new node is created with empty string, when entering node editing mode, the cursor is to the end of the text

master
Denes Matetelki 14 years ago
parent e8731a8e14
commit caeafb77fb

@ -384,7 +384,7 @@ void GraphWidget::insertNode()
QPointF pos(length * cos(angle), length * sin(angle));
Node *node = new Node(this);
node->setHtml(QString("new node"));
node->setHtml(QString(""));
m_scene->addItem(node);
node->setPos(m_activeNode->sceneBoundingRect().center() +
pos -

@ -226,6 +226,10 @@ void Node::setEditable(const bool &editable)
editable ?
Qt::TextEditable :
Qt::NoTextInteraction);
QTextCursor c = textCursor();
c.setPosition(c.document()->toPlainText().length());
setTextCursor(c);
}
void Node::keyPressEvent(QKeyEvent *event)

Loading…
Cancel
Save