gr-fosphor/qt: Qt5 - Track visibility of the widget

When not visible, doing GL operations is not supported

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2019-12-02 20:14:22 +01:00
parent caa88f0a31
commit fa6761afbf
2 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,19 @@ QGLSurface::QGLSurface(QWidget *parent, qt_sink_c_impl *block)
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
void
QGLSurface::hideEvent(QHideEvent *he)
{
this->d_block->cb_visibility(this->isVisible());
}
void
QGLSurface::showEvent(QShowEvent *he)
{
this->d_block->cb_visibility(this->isVisible());
}
void
QGLSurface::paintEvent(QPaintEvent *pe)
{

View File

@ -38,6 +38,8 @@ namespace gr {
QThread *d_gui_thread;
protected:
void hideEvent(QHideEvent *he);
void showEvent(QShowEvent *he);
void paintEvent(QPaintEvent *pe);
void resizeEvent(QResizeEvent *re);
void keyPressEvent(QKeyEvent *ke);