PDA

View Full Version : Defect when displaying menu without submenu



atrofimov
23rd May 2015, 10:31
How to repeat. Create a menu without submenu. Run the program. Click on the menu. A small square appears at the lower left part of the menu.
Insert image (my *.png file) here does not work. "This is not a valid image" ((

anda_skoa
23rd May 2015, 14:03
You seem to have forgotten to include the misbehaving code.

Cheers,
_

atrofimov
30th May 2015, 20:38
I do not know what code should be included. Just follow the steps I described.

ChrisW67
30th May 2015, 22:41
How to repeat. Create a menu without submenu. Run the program. Click on the menu. A small square appears at the lower left part of the menu.
No, works fine.

Specify platform, Qt version, compiler, code that reproduces the problem.


Insert image (my *.png file) here does not work. "This is not a valid image" ((
You mean like this one?
11186
I suggest you give the forum a valid PNG file that is not huge

atrofimov
31st May 2015, 20:11
11187
See the small square. Empty menu has nonzero size.

Windows 7 32-bit
Qt 5.4.3
Visual Studio 2013

Menu was created using Qt Designer.

ars
31st May 2015, 21:27
I could reproduce this behavior with Linux and Qt 4.8.x. To remove this small square, do not add an empty menu to the menubar. Instead, only add an action. In the attached mainwindow.ui, see the menubar entries ABC, DEF, GHI and JKL. ABC and DEF are pure actions (not QMenu), GHI is a QMenu containing another action and JKL is an empty QMenu. ABC, DEF and GHI do not show the tiny square, but JKL does.

The bad thing about this: I had to edit the ui file with a text editor to get QAction into the menubar. I didn't find a way to do this in designer.

ChrisW67
31st May 2015, 21:39
I see "menu without submenu" != "menu with no menu items", hence my confusion.

If the menu is empty and you know it then why not disable the menu (or hide it) so it cannot be clicked and the user does not see the odd rendering?

atrofimov
31st May 2015, 22:00
I understand. But you did not answer the question why this square is displayed. For a project with MFC I have not seen such an effect.
Class QMenu incorrectly itself draws

Added after 9 minutes:

It does not matter. I see a defect. Can you answer me this is a bug library?

jefftee
1st June 2015, 02:46
If you are convinced it's a defect, then you should report (https://bugreports.qt.io/secure/Dashboard.jspa) it... I would recommend searching first so that you don't submit a duplicate bug report if one already exists.