本文整理汇总了C++中DataCurve::moveLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ DataCurve::moveLabels方法的具体用法?C++ DataCurve::moveLabels怎么用?C++ DataCurve::moveLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataCurve
的用法示例。
在下文中一共展示了DataCurve::moveLabels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
bool CanvasPicker::eventFilter(QObject *object, QEvent *e)
{
if (object != (QObject *)plot()->canvas())
return false;
Graph *g = plot();
QList<QwtPlotMarker *> lines = g->linesList();
switch(e->type())
{
case QEvent::MouseButtonPress:
{
const QMouseEvent *me = (const QMouseEvent *)e;
if (!(me->modifiers() & Qt::ShiftModifier))
g->deselect();
emit selectPlot();
bool allAxisDisabled = true;
for (int i=0; i < QwtPlot::axisCnt; i++){
if (g->axisEnabled(i)){
allAxisDisabled = false;
break;
}
}
int dist, point;
g->closestCurve(me->pos().x(), me->pos().y(), dist, point);
if (me->button() == Qt::LeftButton && (g->drawLineActive())){
startLinePoint = me->pos();
return true;
}
if (!g->zoomOn() && selectMarker(me)){
if (me->button() == Qt::RightButton)
emit showMarkerPopupMenu();
return true;
}
return !(me->modifiers() & Qt::ShiftModifier);
}
break;
case QEvent::MouseButtonDblClick:
{
if (d_editing_marker) {
return d_editing_marker->eventFilter(g->canvas(), e);
} else if (g->selectedMarker()) {
if (lines.contains(g->selectedMarker())){
emit viewLineDialog();
return true;
}
} else if (g->isPiePlot()){
emit showPlotDialog(0);
return true;
} else {
const QMouseEvent *me = (const QMouseEvent *)e;
int dist, point;
QwtPlotCurve *c = g->closestCurve(me->pos().x(), me->pos().y(), dist, point);
if (c && dist < 10)
emit showPlotDialog(g->curveIndex(c));
else
emit showPlotDialog(-1);
return true;
}
}
break;
case QEvent::MouseMove:
{
const QMouseEvent *me = (const QMouseEvent *)e;
if (me->state() != Qt::LeftButton)
return true;
QPoint pos = me->pos();
DataCurve *c = g->selectedCurveLabels();
if (c){
c->moveLabels(pos);
return true;
}
if (plot()->drawLineActive()) {
drawLineMarker(pos, g->drawArrow());
return true;
}
return false;
}
break;
case QEvent::MouseButtonRelease:
{
const QMouseEvent *me = (const QMouseEvent *)e;
if (g->drawLineActive()) {
ApplicationWindow *app = g->multiLayer()->applicationWindow();
if (!app)
return true;
ArrowMarker mrk;
//.........这里部分代码省略.........