Skip to content

Crash when using QOpenGLWidget/QOpenGLWindow inside a dock together with QWebEngineView #732

Closed
@martbelko

Description

@martbelko

Issue Description

When using OpenGL (QOpenGLWidget or QOpenGLWindow) within the Qt Advanced Docking System alongside QWebEngineView, the application crashes under specific reordering conditions.

This happens when there is a stack of five widgets with an OpenGL-based widget in the middle and QWebEngineView at the bottom. If a widget below the OpenGL widget is dragged across the OpenGL widget and docked to the top, and then the OpenGL widget is docked above, the application crashes.

Steps to Reproduce

  1. Create a dock layout with a stack of five dock widgets.
  2. Insert a QOpenGLWidget or QOpenGLWindow in the middle of the stack.
  3. Add a QWebEngineView as the bottom-most widget.
  4. Drag the widget immediately below the OpenGL widget upward across it and dock it to the top.
  5. Then drag the OpenGL widget and dock it above the previous one.

Environment

  • Operating System: [Windows 11]
  • Qt Version: [6.5.3]
  • OpenGL Version: [4.6]
  • Qt-Advanced-Docking-System Version: [latest]

Demo

Image

Minimal Reproducible Example:

#include <QApplication>
#include <QOpenGLWidget>
#include <QMainWindow>
#include <QtWebEngineWidgets>

#include <DockManager.h>

class MainWindow : public QMainWindow
{
public:
	MainWindow()
	{
		m_DockManager = new ads::CDockManager(this);

		QWebEngineView* w1 = new QWebEngineView();
		QWebEngineView* w2 = new QWebEngineView();
		QOpenGLWidget* glWidget = new QOpenGLWidget();
		QWidget* w3 = new QWidget();
		QWidget* w4 = new QWidget();

		ads::CDockWidget* dw1 = new ads::CDockWidget("WebView 1");
		dw1->setWidget(w1);
		ads::CDockWidget* dw2 = new ads::CDockWidget("Widget 1");
		dw2->setWidget(w2);
		ads::CDockWidget* glDw = new ads::CDockWidget("OpenGL");
		glDw->setWidget(glWidget);
		ads::CDockWidget* dw3 = new ads::CDockWidget("Widget 2");
		dw3->setWidget(w3);
		ads::CDockWidget* dw4 = new ads::CDockWidget("Widget 3");
		dw4->setWidget(w4);

		m_DockManager->addDockWidget(ads::TopDockWidgetArea, dw1);
		m_DockManager->addDockWidget(ads::TopDockWidgetArea, dw2);
		m_DockManager->addDockWidget(ads::TopDockWidgetArea, glDw);
		m_DockManager->addDockWidget(ads::TopDockWidgetArea, dw3);
		m_DockManager->addDockWidget(ads::TopDockWidgetArea, dw4);
	}
private:
	ads::CDockManager* m_DockManager;
};

int main(int argc, char* argv[])
{
	QApplication app(argc, argv);
	MainWindow window;

	window.show();

	return app.exec();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions