Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6: SoQt has some serious issues when used in Qt6 application - use Quarter instead #79

Open
githubuser0xFFFF opened this issue Apr 26, 2024 · 2 comments
Labels
acknowledged Coin3d team acknowledges this issue bug Something isn't working

Comments

@githubuser0xFFFF
Copy link

githubuser0xFFFF commented Apr 26, 2024

We used an SoQt based viewer in our Qt5 application and now switched to Qt6. We noticed some strange issues with SoQt and switched to Quarter as our new viewer. With Quarter we do not see these problems in Qt6.

We use the SoQt viewer in an application that uses dock widgets, that means the SoQt viewer will get reparented when docking and undocking widgets. This causes application crashs and the following issue:

grafik

Normally the filesystem Auto-Hide widget (1) should be in front of the docked widgets below. While this works properly for the window decoration of the SoQt viewer widget (2), the SoQt widget scene content (2) will be painted in front of the filesystem widget. This does not happen with Qt5 version of SoQt. This does also not happen with the Quarter based viewer (3) with the yellow cone.

That means we see crashes when docking / undocking SoQt widgets and we see paint artefacts with SoQt but Quarter viewer works perfectl - therefore we switched to quarter.

If somenoe would like to see and to reproduce the issue, then do the following steps:

  • please checkout the following project with the openglwidget branch:
    https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/tree/openglwidget

  • add your library path that contains the coin3d libraries to the bottom of the demo.pro file:

    # Add your library search path for external libraries here that contain the
    # coin3d libraries
    #LIBS *= -LC:/path/to/your/coin/libraries
  • build the project with qmake for Qt6 (the cmake build does not work for this branch)

  • run the demo application

Now you can create multiple SoQt viewers (Create Coin3D Viewer), Quarter viewers (Create Quarter Viewer) to test this.

@VolkerEnderlein
Copy link
Collaborator

Thanks for reporting this issue.

I just checked with Qt6 and direct reparenting, as you tried in QtADS, does not work in the current SoQt version. But indirect reparenting via an additional QWidget and setting that as parent of the SoQtExaminerViewer works, see following snippet:

	auto w = new QWidget(this);
	auto Viewer = new SoQtExaminerViewer(w, nullptr, true, SoQtFullViewer::BUILD_ALL);
	Viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
	Viewer->setAnimationEnabled(false);
	Viewer->setFeedbackVisibility(true);
	Viewer->setSampleBuffers(4);
	Viewer->setSceneGraph(Root);
	//d->Viewer->setBackgroundColor(toSbColor(QColor(38, 38, 38)));
	auto DockWidget = new ads::CDockWidget(QString("Coin3D Viewer %1").arg(Coin3DWidgetCount++));
	DockWidget->setIcon(svgIcon(":/adsdemo/images/category.svg"));
	DockWidget->setWidget(w, ads:: CDockWidget::ForceNoScrollArea);

I see that more a work around than a solution, and think we are not connecting to a signal, that is sent when the base widget is reparented. Maybe that handling changed in Qt6 or the QOpenGLWidget does behave different.
Keep up the good work.

@githubuser0xFFFF
Copy link
Author

Hi Volker, thank you for investigating this. The solution of inserting the SoQtExaminerViewer into another QWidget is a nice work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged Coin3d team acknowledges this issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants