FIXED: #1471 The rendered image should no longer disappear from NelGUI widget, when resizing another widget.
This commit is contained in:
parent
1584bdfaf0
commit
8373dd690f
4 changed files with 47 additions and 28 deletions
|
@ -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()
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -96,5 +96,10 @@ namespace GUIEditor
|
||||||
CWidgetManager::getInstance()->drawViews( 0 );
|
CWidgetManager::getInstance()->drawViews( 0 );
|
||||||
getDriver()->swapBuffers();
|
getDriver()->swapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NelGUIWidget::paintEvent( QPaintEvent *evnt )
|
||||||
|
{
|
||||||
|
draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,9 @@ namespace GUIEditor
|
||||||
bool parse( SProjectFiles &files );
|
bool parse( SProjectFiles &files );
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent( QPaintEvent *evnt );
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue