mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Changed: #1193 Update example plugin. Rendering should stop when the widget becomes invisible
This commit is contained in:
parent
15f9937b99
commit
d74082c9c2
2 changed files with 9 additions and 7 deletions
|
@ -122,13 +122,14 @@ void QNLWidget::updateRender()
|
||||||
void QNLWidget::showEvent(QShowEvent *showEvent)
|
void QNLWidget::showEvent(QShowEvent *showEvent)
|
||||||
{
|
{
|
||||||
QWidget::showEvent(showEvent);
|
QWidget::showEvent(showEvent);
|
||||||
if (isVisible())
|
|
||||||
{
|
|
||||||
m_driver->activate();
|
m_driver->activate();
|
||||||
m_mainTimer->start(m_interval);
|
m_mainTimer->start(m_interval);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
void QNLWidget::hideEvent(QHideEvent *hideEvent)
|
||||||
|
{
|
||||||
m_mainTimer->stop();
|
m_mainTimer->stop();
|
||||||
|
QWidget::hideEvent(hideEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(NL_OS_WINDOWS)
|
#if defined(NL_OS_WINDOWS)
|
||||||
|
|
|
@ -96,6 +96,7 @@ private Q_SLOTS:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void showEvent(QShowEvent *showEvent);
|
virtual void showEvent(QShowEvent *showEvent);
|
||||||
|
virtual void hideEvent(QHideEvent *hideEvent);
|
||||||
|
|
||||||
#if defined(NL_OS_WINDOWS)
|
#if defined(NL_OS_WINDOWS)
|
||||||
virtual bool winEvent(MSG *message, long *result);
|
virtual bool winEvent(MSG *message, long *result);
|
||||||
|
|
Loading…
Reference in a new issue