From 8fa32a40a97f7b01fc24d81db21a0a77cdf7b3d3 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 14 Dec 2018 10:12:35 +0000 Subject: [PATCH] Fix m_qtPainter not being initialised in wxCairoContext ctor For some reason one of the overloads of the c'tor left the m_qtPainter field set to NULL rather than asking the wxDC for it's painter. The rest of the class assumes the painter is not NULL. Closes https://github.com/wxWidgets/wxWidgets/pull/1075 --- src/generic/graphicc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index a610eabf64..d98e68756a 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1869,7 +1869,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC& #endif #ifdef __WXQT__ - m_qtPainter = (QPainter*) dc.GetHandle(); + m_qtPainter = static_cast(dc.GetHandle()); // create a internal buffer (fallback if cairo_qt_surface is missing) m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied); // clear the buffer to be painted over the current contents @@ -2084,7 +2084,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& #endif #ifdef __WXQT__ - m_qtPainter = NULL; + m_qtPainter = static_cast(dc.GetHandle()); // create a internal buffer (fallback if cairo_qt_surface is missing) m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied); // clear the buffer to be painted over the current contents