Fix painting logic in wxQt wxClientDC implementation
The original drawing mechanism was generating lots of QWarning messages when running samples (e.g. htlbox, caret, etc.) and in some cases was not actually completely drawing every element of the sample. The issue was that the QPicture was being shared incorrectly between wxWindow and wxClientDC and attempts to start painting, update, etc. were generating console warnings. Closes https://github.com/wxWidgets/wxWidgets/pull/1152
This commit is contained in:
@@ -210,7 +210,7 @@ void wxWindowQt::Init()
|
||||
m_horzScrollBar = NULL;
|
||||
m_vertScrollBar = NULL;
|
||||
|
||||
m_qtPicture = new QPicture();
|
||||
m_qtPicture = NULL;
|
||||
m_qtPainter = new QPainter();
|
||||
|
||||
m_mouseInside = false;
|
||||
@@ -251,7 +251,6 @@ wxWindowQt::~wxWindowQt()
|
||||
|
||||
DestroyChildren(); // This also destroys scrollbars
|
||||
|
||||
delete m_qtPicture;
|
||||
delete m_qtPainter;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
@@ -1126,7 +1125,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event )
|
||||
{
|
||||
bool handled;
|
||||
|
||||
if ( m_qtPicture->isNull() )
|
||||
if ( m_qtPicture == NULL )
|
||||
{
|
||||
// Real paint event (not for wxClientDC), prepare the background
|
||||
switch ( GetBackgroundStyle() )
|
||||
@@ -1558,9 +1557,9 @@ QScrollArea *wxWindowQt::QtGetScrollBarsContainer() const
|
||||
return m_qtContainer;
|
||||
}
|
||||
|
||||
QPicture *wxWindowQt::QtGetPicture() const
|
||||
void wxWindowQt::QtSetPicture( QPicture* pict )
|
||||
{
|
||||
return m_qtPicture;
|
||||
m_qtPicture = pict;
|
||||
}
|
||||
|
||||
QPainter *wxWindowQt::QtGetPainter()
|
||||
|
Reference in New Issue
Block a user