本文整理汇总了C++中Marker::isSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ Marker::isSelected方法的具体用法?C++ Marker::isSelected怎么用?C++ Marker::isSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marker
的用法示例。
在下文中一共展示了Marker::isSelected方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseClick
void Plot::mouseClick (int button, QPoint p)
{
if (! g_symbol)
return;
if (_plotSettings.selected)
{
_plotSettings.selected->click(_plotSettings.status, button, p);
return;
}
QHashIterator<QString, Marker *> it(_plotSettings.markers);
while (it.hasNext())
{
it.next();
Marker *co = it.value();
if (co->readOnly())
continue;
if (! co->isSelected(p))
continue;
_plotSettings.selected = co;
_plotSettings.selected->click(_plotSettings.status, button, p);
return;
}
}
示例2: mouseMove
void Plot::mouseMove (QPoint p)
{
// qDebug() << "mouse move";
if (! _plotSettings.info)
return;
if (! g_symbol)
return;
if (_plotSettings.selected)
{
_plotSettings.selected->move(_plotSettings.status, p);
return;
}
QHashIterator<QString, Marker *> it2(_plotSettings.markers);
while (it2.hasNext())
{
it2.next();
Marker *m = it2.value();
if (! m->isSelected(p))
continue;
QStringList info;
info << _plotSettings.name;
if (! m->info(info))
continue;
_plotInfo->setData(info);
replot();
return;
}
int index = (int) invTransform(QwtPlot::xBottom, p.x());
QStringList info;
info << _plotSettings.name;
_dateScaleDraw->info(index, info);
QHashIterator<QString, Curve *> it(_plotSettings.curves);
while (it.hasNext())
{
it.next();
Curve *curve = it.value();
curve->info(index, info);
}
_plotInfo->setData(info);
replot();
}
示例3: switch
int
MarkerSell::click (PluginData *pd)
{
if (! pd->data)
return 0;
Marker *sell = (Marker *) pd->data;
switch ((PlotStatus::Key) pd->status)
{
case PlotStatus::_SELECTED:
{
switch (pd->button)
{
case Qt::LeftButton:
if (sell->isGrabSelected(pd->point))
{
pd->status = PlotStatus::_MOVE;
return 1;
}
if (! sell->isSelected(pd->point))
{
pd->status = PlotStatus::_NONE;
sell->setSelected(FALSE);
Plot *tplot = (Plot *) sell->plot();
tplot->unselectMarker();
sell->plot()->replot();
return 1;
}
break;
case Qt::RightButton:
{
Plot *p = (Plot *) sell->plot();
p->showMarkerMenu();
break;
}
default:
break;
}
break;
}
case PlotStatus::_MOVE:
{
switch (pd->button)
{
case Qt::LeftButton:
pd->status = PlotStatus::_SELECTED;
return 1;
default:
break;
}
break;
}
default: // _None
{
switch (pd->button)
{
case Qt::LeftButton:
{
if (sell->isSelected(pd->point))
{
pd->status = PlotStatus::_SELECTED;
sell->setSelected(TRUE);
Plot *tplot = (Plot *) sell->plot();
tplot->selectMarker(sell->ID());
sell->plot()->replot();
return 1;
}
break;
}
default:
break;
}
break;
}
}
return 1;
}
示例4: signalMessage
int
MarkerRetracement::click (PluginData *pd)
{
if (! pd->data)
return 0;
Marker *m = (Marker *) pd->data;
switch (pd->status)
{
case PlotStatus::_SELECTED:
{
switch (pd->button)
{
case Qt::LeftButton:
{
int grab = m->isGrabSelected(pd->point);
if (grab)
{
pd->status = PlotStatus::_MOVE;
if (grab == 2)
pd->status = PlotStatus::_MOVE2;
return 1;
}
if (! m->isSelected(pd->point))
{
pd->status = PlotStatus::_NONE;
m->setSelected(FALSE);
Plot *tplot = (Plot *) m->plot();
tplot->unselectMarker();
m->plot()->replot();
return 1;
}
break;
}
case Qt::RightButton:
{
Plot *p = (Plot *) m->plot();
p->showMarkerMenu();
break;
}
default:
break;
}
break;
}
case PlotStatus::_MOVE:
case PlotStatus::_CREATE_MOVE:
{
switch (pd->button)
{
case Qt::LeftButton:
if (pd->status == PlotStatus::_CREATE_MOVE)
{
pd->status = PlotStatus::_MOVE2;
emit signalMessage(tr("Select lowest ending point..."));
return 1;
}
pd->status = PlotStatus::_SELECTED;
return 1;
default:
break;
}
break;
}
case PlotStatus::_MOVE2:
{
switch (pd->button)
{
case Qt::LeftButton:
pd->status = PlotStatus::_SELECTED;
return 1;
default:
break;
}
break;
}
default: // _None
{
switch (pd->button)
{
case Qt::LeftButton:
{
if (m->isSelected(pd->point))
{
pd->status = PlotStatus::_SELECTED;
m->setSelected(TRUE);
Plot *tplot = (Plot *) m->plot();
tplot->selectMarker(m->ID());
m->plot()->replot();
return 1;
}
//.........这里部分代码省略.........