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 0316e0bce9
commit 159deeaab8
4 changed files with 47 additions and 28 deletions

View file

@ -29,6 +29,11 @@ namespace GUIEditor
{ {
driver = NULL; driver = NULL;
textContext = 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() Nel3DWidget::~Nel3DWidget()

View file

@ -43,6 +43,12 @@ namespace GUIEditor
NL3D::UDriver* getDriver() const{ return driver; } NL3D::UDriver* getDriver() const{ return driver; }
NL3D::UTextContext* getTextContext() const{ return textContext; } 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: public Q_SLOTS:
void clear(); void clear();

View file

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

View file

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