Hello again, I want to be able to write text in the QGraphicsscene. I want to be able to do this by clicking button that calls a slot that adds a QGraphicsTextItem in the scene and from there i can start typing. Here is my code below. this is the slot function.
void MainWindow::on_font_btn_clicked()
{
text = new TextItem();
text->setParentItem(page_1);
text->setFont(fontCombo->currentFont());
text->setZValue(1000.0);
scene->addItem(text);
void MainWindow::on_font_btn_clicked()
{
text = new TextItem();
text->setParentItem(page_1);
text->setFont(fontCombo->currentFont());
text->setZValue(1000.0);
scene->addItem(text);
To copy to clipboard, switch view to plain text mode
}
but for some reason this is not working. NB: this text is to be written within the "rect" of the parent item. Am I missing something here?
Bookmarks