Results 1 to 9 of 9

Thread: Defect when displaying menu without submenu

  1. #1
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Defect when displaying menu without submenu

    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" ((

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Defect when displaying menu without submenu

    You seem to have forgotten to include the misbehaving code.

    Cheers,
    _

  3. #3
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Defect when displaying menu without submenu

    I do not know what code should be included. Just follow the steps I described.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Defect when displaying menu without submenu

    Quote Originally Posted by atrofimov View Post
    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?
    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.

  5. #5
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Defect when displaying menu without submenu

    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.

  6. #6
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Defect when displaying menu without submenu

    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.
    Attached Files Attached Files

  7. The following user says thank you to ars for this useful post:

    atrofimov (31st May 2015)

  8. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Defect when displaying menu without submenu

    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?

  9. #8
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Defect when displaying menu without submenu

    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.

  10. #9
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Defect when displaying menu without submenu

    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.

Similar Threads

  1. menu entry which could disable all submenu entries
    By stella1016 in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2012, 17:37
  2. how to add a submenu to a context menu of a QTableWidget
    By berlinud in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2010, 14:38
  3. Replies: 2
    Last Post: 7th July 2010, 12:18
  4. Context Menu's submenu doesn't appear
    By DancingFirefly in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2009, 20:32
  5. QPopup menu--inserting submenu's
    By Pharell in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2007, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.