Results 1 to 1 of 1

Thread: MAC: using macEvent to handle mouseclicks

  1. #1
    Join Date
    Feb 2009
    Posts
    22
    Thanks
    4
    Qt products
    Qt3 Qt4

    Default MAC: using macEvent to handle mouseclicks

    Hi,

    I want to trap the mouse click ( or mouse-up) event on MAC.

    On windows I used the winEvent and it worked fine. But I am not able to get any examples of the macEvent. I have the function as follows:
    Qt Code:
    1. bool myclass::macEvent(EventHandlerCallRef eventHandler, EventRef event)
    2. {
    3. // if (event->type == MouseClick) // Want to put in the code to trap mouse clicks
    4. return false;
    5. }
    To copy to clipboard, switch view to plain text mode 
    Suggestions on how to proceed will be greatly appreciate.

    I also tried using the QT event
    Qt Code:
    1. void myclass::mouseReleaseEvent(QMouseEvent *mouseEvent)
    2. {
    3. if ((mouseEvent->button() == Qt::LeftButton) ||
    4. (mouseEvent->button() == Qt::RightButton) )
    5. {
    6. // I do my stuff here
    7. }
    8. }
    To copy to clipboard, switch view to plain text mode 

    Would this take care of MAC mouse click events?

    Please suggest.Thanks!
    Last edited by gren15; 12th May 2009 at 14:45.

Similar Threads

  1. How to put custom handle image in QSlider using code?
    By montylee in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 19:38
  2. OS/X how to get physical display handle
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 3rd January 2009, 19:51
  3. QSlider custom handle image not displayed
    By planglois in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2008, 13:49

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.