Results 1 to 3 of 3

Thread: QGraphicsView hoto to capture mouve event!

  1. #1
    Join Date
    Jul 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView hoto to capture mouve event!

    Hi,

    I have a custom class that implements QGraphicsView and I have reimplemented the metods:

    Qt Code:
    1. void Cavas::mousePressEvent(QMouseEvent *e){
    2. qDebug()<<"Pressed";
    3. }
    4. void Canvas::mouseMoveEvent(QMouseEvent *e){
    5. qDebug()<<"Moved";
    6. }
    To copy to clipboard, switch view to plain text mode 

    The second method work correctly but the first don't work... what I can wrong??


    Added after 1 35 minutes:


    Sorry I have found the solution. I have write a wrond declaration in che ".h" file, I have write:

    Qt Code:
    1. void mousePressEvent(QMouseEvent event);
    To copy to clipboard, switch view to plain text mode 

    instead of

    Qt Code:
    1. void mousePressEvent(QMouseEvent *event);
    To copy to clipboard, switch view to plain text mode 

    Then I have created a new method than can't proces the event.
    Last edited by Zikoel; 17th September 2011 at 17:55.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 127 Times in 126 Posts

    Default Re: QGraphicsView hoto to capture mouve event!

    and here is a reason why everyone should COPY & PASTE their code, not re-write into the forum

  3. #3
    Join Date
    Jul 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView hoto to capture mouve event!

    The error was in my code not in the post. Hi.

Similar Threads

  1. Capture mouse event on QHeaderView
    By squidge in forum Qt Programming
    Replies: 10
    Last Post: 10th August 2012, 12:54
  2. QGraphicsView::resizeEvent(event)
    By Mrdata in forum Qt Programming
    Replies: 4
    Last Post: 21st June 2011, 18:26
  3. Capture the triggered event of MacWindowToolBarButtonHint
    By alexandersv in forum Qt Programming
    Replies: 0
    Last Post: 11th October 2009, 18:05
  4. QSystemTrayIcon capture mouse hover event
    By alan in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2009, 20:42
  5. Capture a keyboard event
    By mahe2310 in forum Qt Programming
    Replies: 8
    Last Post: 16th February 2006, 12:19

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.