Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QMenu: inadequate delay to mouse over a submenu
Qt 6.12 LTS is out! See what's new in the release blog

[SOLVED] QMenu: inadequate delay to mouse over a submenu

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Has anyone else noticed the poor behavior of QMenu in regards to displaying submenus (at least on Windows - haven't yet tried other platforms)? If you move the mouse diagonally to the submenu, causing the mouse to temporarily hover over an item in the top-level menu, it's difficult to get to the submenu. For example, if you have this menu structure:

    @
    Item0
    Item1->|SubmenuItem0
    Item2 |SubmenuItem1
    Item3 |SubmenuItem2
    Item4 |SubmenuItem3
    @

    Hover over Item1 to display the submenu.

    Start moving the mouse down and to the right toward SubmenuItem3.

    The mouse temporarily hovers over Item2 through Item4 (not necessarily all of them).

    Continue moving to where SubmenuItem3 should be.

    Qt has hidden the submenu, because you hovered over Item2 through Item4.

    This is quite aggravating. Does anyone know if there is a way to increase the amount of delay Qt provides to mouse over to a submenu?

    The layout file here demonstrates the issue. Just load it into Designer, and run it from there.
    https://dl.dropboxusercontent.com/u/3489570/menu_sample.ui

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      After some spelunking in qmenu.cpp, I learned this is controlled by the style hint QStyle::SH_Menu_SloppySubMenus. This returns 0 by default on Windows. Making it return 1 (by installing my own style proxy, via QApplication::setStyle) gets me the improved behavior that is the default on the Mac.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved