Qt app crashes when adding a QMainWindow derived widget to a QMdiArea
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qt-sdk (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In the course of developing an application I have discovered that adding a widget to an MDI area causes a segfault in QWindow::winId() when the widget added is derived from QMainWindow and is created using a compiled .ui file from QtDesigner. Creating a visually-identical UI but hand-coding the widget layout in C++ works as expected.
I have found this bug is reliable with Qt5.9.1 installed from the stock Kubuntu repositories. It occurs consistently on two different machines with this setup. The bug does not occur with Qt5.9.2 (installed directly from the Qt maintenance tool), and I've had it confirmed that it does *not* occur on Qt 5.9.2 64bit MSVC2013 Windows.
I have attached a sample stack trace. I have also created a very small example project on github that consistently produces the segfault on the setup I mentioned above. The github repo is here:
https:/
I *think* the issue is in the libqt5widgets5 package but I can't be certain. I guess it's possible that it's an issue in the Breeze KDE theme or upstream in Qt?
lsb_release -rd
Description: Ubuntu 17.10
Release: 17.10
I've researched the issue a bit more, based on the fact that the stack trace shows calls to KDEPlasmaPlatfo rmTheme. so from within QMenuBar. So the issue is repeatable in the following circumstances:
- running on KDE Plasma
- having one (or more) Global Menu widgets in a panel or on the desktop
- having the setting "Application Style/Fine Tuning/Menubar Style" set to "Application Menu widget" in the KDE System Settings application.
- The QMainWindow being added to the MDI area has a menu bar.
It does *not* occur when the Plasma Global Menu widget is not in use (i.e. the setting "Application Style/Fine Tuning/Menubar Style" is set to something else.
My conclusion, therefore, is that I need to report this as an issue for KDE Plasma, so I'm closing this issue.