Fix several problem with wxMemoryDC in wxQt

Under wxQT, wxMemoryDC was previously rendering to a temporary image
which was only being blitted back to the original wxBitmap when either
the DC wx destroyed or a new bitmap was selected (via SelectObject).

With these change wxMemoryDCImpl now draws directly to the bitmap
managed by wxBitmap, this makes the behaviour more consistent with the
MSW and GTK implementations.

Closes https://github.com/wxWidgets/wxWidgets/pull/1083
This commit is contained in:
Graham Dawes
2018-12-17 11:48:59 +00:00
committed by Vadim Zeitlin
parent 80904d1bc7
commit ae20edb539
6 changed files with 40 additions and 59 deletions

View File

@@ -31,7 +31,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner )
: wxQtDCImpl( owner )
{
m_window = NULL;
m_qtImage = NULL;
m_ok = false;
m_qtPainter = new QPainter();
}
@@ -40,7 +39,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *win )
: wxQtDCImpl( owner )
{
m_window = win;
m_qtImage = NULL;
m_qtPainter = m_window->QtGetPainter();
// if we're not inside a Paint event, painter will invalid
m_ok = m_qtPainter != NULL;