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] Mouse press and hold event for QWindow?
Forum Updated to NodeBB v4.3 + New Features

[Solved] Mouse press and hold event for QWindow?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.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.
  • I Offline
    I Offline
    infinicat
    wrote on last edited by
    #1

    I have a QWindow-derived class and want to know when the user left-mouse clicks and holds down this click. The user will not be moving the mouse at this time. I already catch the MouseButtonPress event when mouse button is pressed down but then no other events are sent until the mouse button is released.

    I saw that the MouseArea QML type has a pressAndHold signal. Is there something like this for QWindow? Or do I need to implement this feature myself.

    I'm using Qt 5.4.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Subst27
      wrote on last edited by
      #2

      may be you can get signals about mouse moving with pressed button throw Drag-and-Drop engine?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        AFAIK, there's no equivalent. However you can use e.g. a QTimer for that purpose.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • I Offline
          I Offline
          infinicat
          wrote on last edited by
          #4

          I ended up using a QTimer. I basically used \Qt5.4.0\5.4\Src\qtdeclarative\src\plugins\qmltooling\qmldbg_qtquick2\inspecttool.cpp as a guide.

          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