Source
xxxxxxxxxx
// modified julian days into a casacore::String representation of the date, using a
//# QPCanvasHelpers.qo.h: Helper classes for QPCanvas.
//# Copyright (C) 2008
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id: $
namespace casa {
//# Forward Declarations
class QPCanvas;
// Miscellaneous Classes //
// Filter to install on the QwtPlotCanvas to catch mouse move events (which
// are otherwise stolen by other filters in QwtPicker classes).
class QPMouseFilter : public QObject {
Q_OBJECT
public:
// Constructor which takes the canvas to install itself on.
QPMouseFilter(QwtPlotCanvas* canvas);
QPMouseFilter(QWidget* widget);
// Destructor.
~QPMouseFilter();
// Turns mouse tracking on or off on the underlying canvas.
void turnTracking(bool on);
signals:
// This signal is emitted if tracking is turned on, and when a
// QMouseEvent is received for a mouse move on the underlying canvas.
void mouseMoveEvent(QMouseEvent* e);
protected:
// Filter the events on the given object. Checks only for mouse events
// on the underlying canvas.
bool eventFilter(QObject* obj, QEvent* ev);
private:
// Canvas.
QwtPlotCanvas* m_canvas;
};
// Subclass of QwtScaleDraw to implement additional functionality. Keeps track
// of which PlotAxisScale is set, and can use reference values instead of