Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.0.0
-
None
-
Ubuntu, Xcb
-
3a2b3fc0d72fe1e52a7830e03f849963f6b73e02
Description
1) Run the provided test code;
Expected: no error messages in the console
Actual:
QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QPainter::begin: Paint device returned engine == 0, type: 3
TEST CODE:
class Widget : public QLabel { Q_OBJECT public: Widget():QLabel() { if (pix.load("logo.png")) qDebug() << "pixmap loaded"; else qDebug() << "failed to load pixmap"; setPixmap(pix); } protected: void mousePressEvent(QMouseEvent *ev) { QMimeData *mimeData = new QMimeData; mimeData->setImageData(pix.toImage()); QDrag *drag = new QDrag(this); drag->setMimeData(mimeData); //drag->setPixmap(pix); // add this line to suppress QPainter warnings drag->exec(); } private: QPixmap pix; }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget wid; wid.show(); return a.exec(); }