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 we can know a mouse left pointer or right pointer is moving inside mouse move event while the button is in pressedhold state and moving?
Forum Updated to NodeBB v4.3 + New Features

How we can know a mouse left pointer or right pointer is moving inside mouse move event while the button is in pressedhold state and moving?

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

    When a mouse left or right pointer is pressed and moved i have tried this @event->button == Qt::LeftButton()@ inside mouse move event but it always return zero it does not depend whether the left or right mouse pointer is pressed and moved . How can i detect left mouse pointer or right is pressed and moved inside mouse move event.

    Pratik Agrawal

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      You mixed up a function and an enumerator member. Try this:
      @event->button() == Qt::LeftButton@

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pratik041
        wrote on last edited by
        #3

        No i have tried that only what you are saying i have mistakenly left the braces but i am not getting it.

        Pratik Agrawal

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Please show a bigger section of your code, I suggest the whole function if it is not too long. We cannot judge what your application is doing based on a single line of code that appearantly isn't even directly from your sources.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pratik041
            wrote on last edited by
            #5

            Actually i have tried it taking different approach by using flag in mousepressEvent to detect left or right click and used the same flag in mouse move event and now it is working.

            Pratik Agrawal

            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