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" ((
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" ((
You seem to have forgotten to include the misbehaving code.
Cheers,
_
I do not know what code should be included. Just follow the steps I described.
No, works fine.
Specify platform, Qt version, compiler, code that reproduces the problem.
You mean like this one?Insert image (my *.png file) here does not work. "This is not a valid image" ((
ILTQq.png
I suggest you give the forum a valid PNG file that is not huge
"We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.
Screenshot_3.jpg
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.
Last edited by atrofimov; 31st May 2015 at 20:16.
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.
atrofimov (31st May 2015)
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?
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?
Last edited by atrofimov; 31st May 2015 at 22:00.
If you are convinced it's a defect, then you should report it... I would recommend searching first so that you don't submit a duplicate bug report if one already exists.
Bookmarks