Hi there,
What I did:
#ifndef MYQAREASERIES_H
#define MYQAREASERIES_H
#include <QMouseEvent>
class myQAreaSeries : public QAreaSeries{
Q_OBJECT
protected:
public:
myQAreaSeries();
~myQAreaSeries();
};
#ifndef MYQAREASERIES_H
#define MYQAREASERIES_H
#include <QMouseEvent>
class myQAreaSeries : public QAreaSeries{
Q_OBJECT
protected:
virtual void mousePressEvent(QMouseEvent *);
public:
myQAreaSeries();
~myQAreaSeries();
};
To copy to clipboard, switch view to plain text mode
#include "myqareaseries.h"
myQAreaSeries::myQAreaSeries(){
...
}
void myQAreaSeries
::mousePressEvent(QMouseEvent *event
){ qDebug() << "button is pressed";
}
#include "myqareaseries.h"
myQAreaSeries::myQAreaSeries(){
...
}
void myQAreaSeries::mousePressEvent(QMouseEvent *event){
qDebug() << "button is pressed";
}
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
Bookmarks