Hey!
I had been trying to modify QwtPlotPanner to repaint plot canvas during panning, until I read that this is impossible and I should install an event filter instead, which would catch mouse clicks and repaint the plot using setAxisScale(). I did this, but I the event filter is not called. My code is like the following:
{
...
createAxes();
createLegend();
installEventFilter(m_eventFilter);
...
installPlotZoomer();
installPlotPicker();
}
Plot::Plot(QWidget *parent):
QwtPlot(parent)
{
...
createAxes();
createLegend();
installEventFilter(m_eventFilter);
...
installPlotZoomer();
installPlotPicker();
}
To copy to clipboard, switch view to plain text mode
where event filter is the following short calss:
class MyEventFilter
: public QObject{
protected:
std::cout << "MyEventFilter::eventFilter()" << std::endl;
return true;
}
};
class MyEventFilter : public QObject
{
protected:
bool eventFilter(QObject *, QEvent *) {
std::cout << "MyEventFilter::eventFilter()" << std::endl;
return true;
}
};
To copy to clipboard, switch view to plain text mode
MyEventFilter is not called. Any ideas why not?
Thank you in advance!
Bookmarks