Results 1 to 5 of 5

Thread: Right Mouseclick on QAreaSeries - no response

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2015
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Right Mouseclick on QAreaSeries - no response

    Hi there,

    What I did:

    Qt Code:
    1. #ifndef MYQAREASERIES_H
    2. #define MYQAREASERIES_H
    3.  
    4. #include <QMouseEvent>
    5.  
    6. class myQAreaSeries : public QAreaSeries{
    7.  
    8. Q_OBJECT
    9.  
    10. protected:
    11. virtual void mousePressEvent(QMouseEvent *);
    12.  
    13. public:
    14. myQAreaSeries();
    15. ~myQAreaSeries();
    16.  
    17. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "myqareaseries.h"
    2.  
    3. myQAreaSeries::myQAreaSeries(){
    4. ...
    5. }
    6.  
    7. void myQAreaSeries::mousePressEvent(QMouseEvent *event){
    8. qDebug() << "button is pressed";
    9. }
    To copy to clipboard, switch view to plain text mode 

    No reaction.

    What am I doing wrong here?

    • 1 Do I somehow have to activate mousetracking?
    • 2 Do I have have to call "mousePressEvent(..)" somehow. And if...how?


    This is my first "from the scratch" inplementation of mouseclicks. Up to now I always could use some predefined Signal (i.e. rightClicked()). There is a "clicked()" signal on QAreaSeries, but reacts only on leftclick. I could also use the "pressed()" signal. But I'd like to learn the "proper" way.

    Thanks in advance, Lars
    Last edited by mustermann.klaus@gmx.de; 6th March 2019 at 08:29. Reason: subscribed to notification

Similar Threads

  1. Mouseclick outside from widget
    By binio in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2013, 05:53
  2. Selecting next line with mouseclick
    By Jake123 in forum Newbie
    Replies: 1
    Last Post: 4th February 2013, 06:21
  3. Getting sender for mouseclick with QwtPlot
    By lxman in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2011, 01:43
  4. how to get MouseClick Event in this case
    By yxmaomao in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2008, 03:03
  5. select QGraphicsItems by mouseclick
    By Shawn in forum Qt Programming
    Replies: 20
    Last Post: 31st July 2007, 13:23

Tags for this Thread

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.