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. How to disable the windows 10 press and hold default behavior on my Qt App ?
Forum Updated to NodeBB v4.3 + New Features

How to disable the windows 10 press and hold default behavior on my Qt App ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 273 Views 2 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.
  • A Offline
    A Offline
    Amarjit123
    wrote on 19 Jul 2021, 11:23 last edited by Amarjit123
    #1

    Hello All,

    I have a Qt application whose frontend is in angular, and backend is in Qt. Basically when I run my application on Windows 10 touch screen machine, and Press and hold, I get the context menu opened which is the default behavior for Windows 10 touch enabled machine. I have to disable this feature of windows on my Application. I got some idea to use QGuesture class Cancelpolicy, but don't know how to code it and achieve my target. Could anyone please guide me if it is correct approach, if yes, Can you please send a sample code, which disable the Press and hold default behavior ? Initially I will create a small Qt app and try to disable the Press and hold behavior.

    P 1 Reply Last reply 19 Jul 2021, 11:40
    0
    • A Amarjit123
      19 Jul 2021, 11:23

      Hello All,

      I have a Qt application whose frontend is in angular, and backend is in Qt. Basically when I run my application on Windows 10 touch screen machine, and Press and hold, I get the context menu opened which is the default behavior for Windows 10 touch enabled machine. I have to disable this feature of windows on my Application. I got some idea to use QGuesture class Cancelpolicy, but don't know how to code it and achieve my target. Could anyone please guide me if it is correct approach, if yes, Can you please send a sample code, which disable the Press and hold default behavior ? Initially I will create a small Qt app and try to disable the Press and hold behavior.

      P Online
      P Online
      Pl45m4
      wrote on 19 Jul 2021, 11:40 last edited by
      #2

      @Amarjit123

      Set the contextMenuPolicy on your widget

      • https://doc.qt.io/qt-5/qt.html#ContextMenuPolicy-enum

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1

      1/2

      19 Jul 2021, 11:23

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved