Results 1 to 6 of 6

Thread: Set mouse tracking issue

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Set mouse tracking issue

    You are saying that this always outputs "Move" messages regardless of mouse buttons:
    Qt Code:
    1. #include <QtGui>
    2. #include <QDebug>
    3.  
    4. class MyView: public QGraphicsView {
    5. Q_OBJECT
    6. public:
    7. MyView(QWidget *p = 0): QGraphicsView(p)
    8. {
    9. resize(QSize(320, 240));
    10. qDebug() << hasMouseTracking(); // outputs false
    11. }
    12.  
    13. protected:
    14. void mouseMoveEvent( QMouseEvent * event )
    15. {
    16. qDebug() << "Move";
    17. }
    18. };
    19.  
    20.  
    21. int main(int argc, char *argv[])
    22. {
    23. QApplication app(argc, argv);
    24.  
    25. MyView m;
    26. m.show();
    27.  
    28. return app.exec();
    29. }
    30. #include "main.moc"
    To copy to clipboard, switch view to plain text mode 
    Certainly doesn't here with Qt 4.7.4.

    Post a small, compilable example that demonstrates the problem.

  2. The following user says thank you to ChrisW67 for this useful post:

    sajis997 (24th January 2012)

Similar Threads

  1. tracking mouse coordinates
    By lightning2911 in forum Newbie
    Replies: 8
    Last Post: 11th December 2011, 23:51
  2. qwtplot and mouse tracking
    By fearu in forum Qwt
    Replies: 6
    Last Post: 15th October 2010, 09:28
  3. mouse tracking on image
    By vermarajeev in forum Qt Programming
    Replies: 14
    Last Post: 12th May 2010, 13:06
  4. mouse tracking in QGraphicsItem
    By christina123y in forum Qt Programming
    Replies: 10
    Last Post: 9th March 2009, 08:23
  5. [QT3+XP] transparency and mouse tracking
    By incapacitant in forum Newbie
    Replies: 9
    Last Post: 17th February 2006, 18: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
  •  
Qt is a trademark of The Qt Company.