Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
6.8.3, 6.9.0, 6.10.0
Description
Reproducer attached. It shows a QMainWindow whose context menu event is overridden. By right click in the window a QMenu with a sub menu pops up. That sub menu is going to to show a QWidgetAction that should be a QLabel.
The problem is that the QLabel is put into a layout which is set as the layout as a "root" QWidget. And that "root widget" is set as the default widget of QWidgetAction, i.e. "setDefaultWidget(pWidget);" inside PriorityActionWidget constructor. Then the result looks like:
So actually QWidgetAction is not rendering its widget at all.
The workaround I found so far is to set the label as the default widget, i.e. "setDefaultWidget(label);". Then QLabel is visible. But the result is not as pretty as expected. That is the reason I suspect that QWidgetAction may have problem dealing with "complex" widgets (QLabel->QLayout->QWidget) since a simple QLabel works.
It is said that the latest "dev" branch can give expected result. I've tried the 6.10.0 snapshot that I download from online installer - the problem is still there. So some commits between that 6.10.0 snapshot being packed into online installer and the latest branch must have solved the problem. So please backport.
Attachments
Issue Links
- duplicates
-
QTBUG-133215 [Reg 6.6 -> 6.8] QMainWindow removes titlebar exception
-
- Closed
-