Results 1 to 12 of 12

Thread: Strange mouseReleaseEvent behaviour.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Apr 2009
    Posts
    132
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    67
    Thanked 6 Times in 5 Posts

    Default Re: Strange mouseReleaseEvent behaviour.

    Quote Originally Posted by spirit View Post
    your code will work in this case, i.e. if you pressed two or more mouse buttons then QMouseEvent::buttons will retrun all pressed buttons, that's why this function doesn't work for one button.
    Wait. Still don't understand.
    Which case? Mine or Spirit?

    if I press two buttons at the same time, and I release them at the same time, how many event would I receive? 1 or 2?

    I think moving the mouse I will receive only 1, so I have to use:
    (event->buttons() & Qt::LeftButton) and (event->buttons() & Qt::RightButton)

    But not on release and press, as I guess I will only receive 1. So I have to use:
    (event->button() == Qt::LeftButton) or (event->button() == Qt::RightButton)

    Am I right?

    Thanks a lot for your help and time.
    Last edited by ricardo; 5th May 2009 at 10:42.

Similar Threads

  1. Strange xml behaviour when opening the file.
    By cbarmpar in forum Qt Programming
    Replies: 5
    Last Post: 28th September 2008, 20:44
  2. qinputdialog strange behaviour
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2008, 19:29
  3. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 17:38
  4. Replies: 1
    Last Post: 26th February 2006, 05:52
  5. [Qt 4.1] Strange behaviour with QTableView
    By fane in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 06:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.