FIXED: #1471 The rendered image should no longer disappear from NelGUI widget, when resizing another widget.

This commit is contained in:
dfighter1985 2012-07-20 20:31:47 +02:00
parent 1584bdfaf0
commit 8373dd690f
4 changed files with 47 additions and 28 deletions

View file

@ -29,6 +29,11 @@ namespace GUIEditor
{
driver = NULL;
textContext = NULL;
// Need to set this attribute with a NULL paintengine returned to Qt
// so that we can render the widget normally ourselves, without the image
// disappearing when a widget is resized or shown on top of us
setAttribute( Qt::WA_PaintOnScreen, true );
}
Nel3DWidget::~Nel3DWidget()

View file

@ -43,6 +43,12 @@ namespace GUIEditor
NL3D::UDriver* getDriver() const{ return driver; }
NL3D::UTextContext* getTextContext() const{ return textContext; }
// Need to return NULL paintengine to Qt so that we can
// render the widget normally ourselves, without the image
// disappearing when a widget is resized or shown on top of us
QPaintEngine* paintEngine() const{ return NULL; }
public Q_SLOTS:
void clear();

View file

@ -96,5 +96,10 @@ namespace GUIEditor
CWidgetManager::getInstance()->drawViews( 0 );
getDriver()->swapBuffers();
}
void NelGUIWidget::paintEvent( QPaintEvent *evnt )
{
draw();
}
}

View file

@ -35,6 +35,9 @@ namespace GUIEditor
bool parse( SProjectFiles &files );
void draw();
protected:
void paintEvent( QPaintEvent *evnt );
};
}