QGraphicsTextItem QPainter::begin: Paint device returned engine == 0, type: 2
-
i use win 7 x64 OS
-
use Qt 5.1.1 vc2010 openGl and try build project on Qt 5.1.1 vc 2012
-
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();
}@
-
i checked the bug report system? nothing similar.
-
Works fine on Ubuntu with Qt 5.2.1
-
currently i use Desktop Qt 5.2.1 MSVC2010 32bit OpenGL Win 7 x64, and it does not work
-
bq. Works fine on Ubuntu with Qt 5.2.1 bq
you tried add multiple lines?
-
You mean like this:
@QGraphicsTextItem* ti = new QGraphicsTextItem("text1\ntest2\ntest3");@This does work, or do I not understand your question
-
-
[quote author="DBoosalis" date="1393947922"]You mean like this:
@QGraphicsTextItem* ti = new QGraphicsTextItem("text1\ntest2\ntest3");@This does work, or do I not understand your question[/quote]
when typing on the keyboard in the text box