Results 1 to 3 of 3

Thread: RightMouseMove Event problem

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default RightMouseMove Event problem

    Dear Friends
    I am trying to trap the rightMousemove event()

    void GraphicsViewMesh::mouseMoveEvent(QMouseEvent *me)
    {

    if(me->button() & Qt::RightButton)
    {
    zoomIn();
    }

    }

    //can anyone tell me whats wrong in this my zoomIn() function is not working !

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: RightMouseMove Event problem

    Hi,

    Change this line:
    Qt Code:
    1. if(me->button() == Qt::RightButton)
    To copy to clipboard, switch view to plain text mode 

    In your statment
    Qt Code:
    1. if(me->button() & Qt::RightButton)
    To copy to clipboard, switch view to plain text mode 
    You are asking if "me->button()" and "Qt::RightButton" are equal to 1(or true).
    Òscar Llarch i Galán

  3. #3
    Join Date
    Aug 2009
    Posts
    92
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: RightMouseMove Event problem

    Quote Originally Posted by ^NyAw^ View Post
    In your statment
    Qt Code:
    1. if(me->button() & Qt::RightButton)
    To copy to clipboard, switch view to plain text mode 
    You are asking if "me->button()" and "Qt::RightButton" are equal to 1(or true).
    Not really, he's asking if bit "Qt::RightButton" (2nd bit) of variable returned by me->button() is 1

Similar Threads

  1. Sending event from child widget
    By scascio in forum Qt Programming
    Replies: 6
    Last Post: 28th September 2009, 21:18
  2. Event Process Problem
    By nrabara in forum Newbie
    Replies: 0
    Last Post: 14th September 2009, 09:56
  3. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  4. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.