PDA

View Full Version : [solved] How to activate a QPainter::beginNativePainting, Painter inactive QGLWidget?



ralfwickum
13th July 2015, 09:38
Hello,

I got a *.dll file with follwing class signature



class Render_WidgetGL: public QGLWidget {
Q_OBJECT
//..
}


I created such a Render_WidgetGL object and set that to a layout object



Render_WidgetGL* renderWidget = new Render_WidgetGL(resources);
QGridLayout* gridLayout = new QGridLayout;
gridLayout->addWidget(renderWidget, 0, 1);
ui->horizontalLayout_5->addLayout(gridLayout);


When I start and execute my application I got following message:

RenderProject|nderBackendOpenGlES2|Using GLEW 1.12.0
RenderProject|nderBackendOpenGlES2|OpenGL 2.0: 1
QPainter beginNativePainting: Painter not active
QPainter setRenderHint: Painter must be active to set rendering hints
QPainter beginNativePainting: Painter not active
QPainter beginNativePainting: Painter not active

I do not have such a Painter object in my code, so I assume it comes within the *.dll library. So how can I activate the Painter ? (By the way: The Qt docssay, that QGlWidget is obsolete)

Thnx in advance! Regards

ralfwickum
13th July 2015, 13:33
Replacing


painter.beginNativePainting();
painter.endNativePainting();

through


painter.begin(this);
painter.end();

fixed it for me!