QGraphicsTextItem QPainter::begin: Paint device returned engine == 0, type: 2
-
i set up QGraphicsView and QGraphicsScene, and added into QGraphicsScene some custom graphic items Inherited from QGraphicsObject and all of this works fine with caching and without.
item is child custom graphic object
if add item into scene directly and type in text item single line all ok, if 2 and more lines then error
-
Hi and welcome to devnet,
Which version of Qt on which OS are you using ?
Also, since you seem to reliably trigger this, did you took a look at the "bug report system":http://bugreports.qt-project.org ?
-
Did you check the bug report system ?
If there's nothing there, please prepare a minimal compilable example (which sometimes allows you to also find errors in your code) that reproduces the problem. Once it's done you should open a new bug report with it.
-
@#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QGraphicsView>
#include <QLayout>
#include <QMainWindow>int main(int argc, char argv[])
{
QApplication a(argc, argv);
QMainWindow window = new QMainWindow();
window->setFixedSize(200, 200);QGraphicsScene* scene = new QGraphicsScene(window->rect(), window); QGraphicsTextItem* ti = new QGraphicsTextItem("text"); ti->setTextInteractionFlags(Qt::TextEditorInteraction); ti->setCacheMode(QGraphicsObject::ItemCoordinateCache); ti->setPos(100, 100); QGraphicsView* view = new QGraphicsView(window); view->setScene(scene); scene->addItem(ti); window->layout()->addWidget(view); view->resize(window->size()); window->show(); return a.exec();
}@
-