好吧,剛剛結束覆蓋QwtPicker的相關功能,這工作正常。
class MyQwtPlotZoomer : public QwtPlotZoomer
{
public:
MyQwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas* canvas, bool doReplot = true) : QwtPlotZoomer(xAxis, yAxis, canvas, doReplot){ }
virtual ~MyQwtPlotZoomer(){ }
protected:
virtual void widgetKeyPressEvent(QKeyEvent* ke)
{
if (!isActive())
{
if (keyMatch(KeyUndo, ke))
zoom(-1);
else if (keyMatch(KeyRedo, ke))
zoom(+1);
else if (keyMatch(KeyHome, ke))
zoom(0);
}
}
virtual void widgetKeyReleaseEvent(QKeyEvent*){ }
};
來源
2017-07-05 11:47:49
Ben