本文整理汇总了C++中QwtPlotCanvas::setMouseTracking方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCanvas::setMouseTracking方法的具体用法?C++ QwtPlotCanvas::setMouseTracking怎么用?C++ QwtPlotCanvas::setMouseTracking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotCanvas
的用法示例。
在下文中一共展示了QwtPlotCanvas::setMouseTracking方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QwtPlotPicker
LineChartPicker::LineChartPicker(QwtPlot *plot) :
QwtPlotPicker(plot->canvas()),
p(plot)
{
QwtPlotCanvas *canvas = plot->canvas();
canvas->installEventFilter(this);
canvas->setFocusPolicy(Qt::StrongFocus);
canvas->setMouseTracking(true);
canvas->setFocusIndicator(QwtPlotCanvas::ItemFocusIndicator);
canvas->setFocus();
}
示例2: QDialog
DialogFunction::DialogFunction( const LinearFunction::Description::Ptr& pDescription,
const QPolygonF& curveSamples,
QWidget* pParent)
: QDialog(pParent)
, _pDescription(pDescription)
, _indexSelectedPoint(-1)
, _relativeIndex(0)
{
setupUi(this);
widgetPlot->setMinimumSize(1,1);
widgetPlot->setAxisScale(QwtPlot::xBottom, _pDescription->xMin, _pDescription->xMax);
widgetPlot->setAxisScale(QwtPlot::yLeft, _pDescription->yMin, _pDescription->yMax);
widgetPlot->setAxisMaxMinor(QwtPlot::yLeft, 2);
widgetPlot->setAxisMaxMinor(QwtPlot::xBottom, 2);
widgetPlot->setCanvasBackground(QColor(Qt::black));
widgetPlot->setAxisTitle(QwtPlot::xBottom, _pDescription->szLabelX);
widgetPlot->setAxisTitle(QwtPlot::yLeft, _pDescription->szLabelY);
_pCurve.reset(new QwtPlotCurve());
_pCurve->setStyle(QwtPlotCurve::Lines);
_pCurve->setPen(Qt::white);
_pCurve->setSymbol(new QwtSymbol(QwtSymbol::Diamond, Qt::lightGray, _pCurve->pen(), QSize(8,8)));
QwtArraySeriesData<QPointF>* pSeries = static_cast<QwtArraySeriesData<QPointF>*>(_pCurve->data());
if (pSeries)
{
_pCurve->setSamples(curveSamples);
}
_pCurve->attach(widgetPlot);
QwtPlotGrid* pGrid = new QwtPlotGrid;
pGrid->setMajorPen(QPen(Qt::gray, 0, Qt::DotLine));
pGrid->attach(widgetPlot);
QwtPlotCanvas* pPlotCanvas = static_cast<QwtPlotCanvas*>(widgetPlot->canvas());
pPlotCanvas->installEventFilter(this);
pPlotCanvas->setMouseTracking(true);
}