Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Qt5 QMenuBar in QMainWindow does not respond properly to touch on Windows 8
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt5 QMenuBar in QMainWindow does not respond properly to touch on Windows 8

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • S Offline
    S Offline
    sean.e
    wrote on last edited by
    #1

    I just moved my application from Qt 4.4 to Qt 5.0. On a touch tablet (Samsung Series 7) running Windows 8, using Qt 4.4, I am able to operate the menubar (QMenuBar) in my main window (QMainWindow) via touch without any issues.

    However, after moving to Qt 5.0, using touch to operate the menu is a very frustrating experience. Sub-menus do not stay open unless doing a long-press. Sometimes the sub-menus simply close after pressing a menu item without firing the expected actions. Sometimes the menu item actions fire. A search of the forum doesn't appear to show anyone else with similar issues.

    Is there a property or method I should set/call to make the menu work with touch (as it does with Qt 4.4)?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sean.e
      wrote on last edited by
      #2

      Found a way to fix touch support in Qt menus on Win8:

      @
      ::UnregisterTouchWindow((HWND)menuBar()->winId());
      ...
      // repeat for each menu added to the menubar
      ::UnregisterTouchWindow((HWND)fileMenu->winId());
      @

      By disabling touch, the menu works with touch on Windows 8 (?!?).

      I suppose that unregistering the menu means that I'm circumventing the Qt touch support that was added after 4.4.

      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 Extensions
      • Unsolved