Commit afb7d435 authored by Jan Möbius's avatar Jan Möbius

Prepare some things for qt4.6

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7983 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 95876954
......@@ -78,10 +78,23 @@ QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views,
void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
{
if (_painter->paintEngine()->type() != QPaintEngine::OpenGL) {
std::cerr << "QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view\n";
return;
}
// Check for switch in qt4.6 to OpenGL2
#if QT_VERSION >= 0x040600
if (_painter->paintEngine()->type() != QPaintEngine::OpenGL && _painter->paintEngine()->type() != QPaintEngine::OpenGL2 ) {
std::cerr << "QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view\n";
return;
}
#else
if (_painter->paintEngine()->type() != QPaintEngine::OpenGL ) {
std::cerr << "QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view\n";
return;
}
#endif
#if QT_VERSION >= 0x040600
// #warning untested!
// _painter->beginNativePainting();
#endif
static bool initialized = false;
if (!initialized)
......@@ -131,6 +144,10 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
views_->at(i)->paintGL();
}
#if QT_VERSION >= 0x040600
// #warning untested!
// _painter->endNativePainting();
#endif
if (layout_->mode() != QtMultiViewLayout::SingleView)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment