QQuiickWidgets within TabWidgets crashes when rendering OpenGL code

363 Views Asked by At

QQuickWidgets embedded in QTabWidget container, crashes upon rendering custom OpenGL code, via QML, QQuickItem and QSGNode.

The crash or scene flickering happens when you click on the other tabs on the QTabWidget and return back to the rendering tab.

QQuickWidget* m_quickWidget = new QQuickWidget;


QTabWidget *tabs = new QTabWidget(this);

tabs->addTab(m_quickWidget,"TAB Rendering");
tabs->addTab(new QWidget(),"TAB 1");

m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView );
m_quickWidget->setSource(source);
setCentralWidget(tabs);

The above scenario runs peacefully without any problem when using QQuickViews:

QTabWidget *tabs = new QTabWidget(this);
QWidget* vw = QWidget::createWindowContainer(m_quickWidget);
tabs->addTab(vw,"TAB Rendering");
tabs->addTab(new QWidget(),"TAB 1");

I have attached a qt project for emphasizing the problem

back trace for more info

1

There are 1 best solutions below

1
On

Hi we have seen similar things including the black flickering, however 5.5 seems to have made that black flicker go away. Have you tried that?

Also, I would recommend that you post it on the Qt bug tracker so that someone from the Qt dev team can recreate and fix the problem.