From cff5360280c763b76ef70e42a2d66a1a755bcb35 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Mon, 24 Oct 2016 18:57:39 +0300 Subject: [PATCH] [qt] Fix macOS Qt demo app with Qt4.x --- platform/qt/app/mapwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index ca73b0a8d..0cce6caae 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -297,5 +297,15 @@ void MapWindow::resizeGL(int w, int h) void MapWindow::paintGL() { m_frameDraws++; + +#if QT_VERSION < 0x050400 && defined(__APPLE__) + // XXX GL framebuffer is valid only after first attempt of painting on + // older versions of Qt on macOS. + // See https://bugreports.qt.io/browse/QTBUG-36802 for details. + static bool first = true; + if (!first) m_map.render(); + first = false; +#else m_map.render(); +#endif }