summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-10-24 18:57:39 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-10-24 21:38:12 +0300
commitcff5360280c763b76ef70e42a2d66a1a755bcb35 (patch)
treec17604f16a52ac1870070c541cb97035b744a70b
parentbc4cf3220c0baf74cb771388f7fb216fc29ed8fe (diff)
downloadqtlocation-mapboxgl-cff5360280c763b76ef70e42a2d66a1a755bcb35.tar.gz
[qt] Fix macOS Qt demo app with Qt4.x
-rw-r--r--platform/qt/app/mapwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index ca73b0a8da..0cce6caaed 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
}