当前位置: 首页>>代码示例>>C++>>正文


C++ Marker::isSelected方法代码示例

本文整理汇总了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;
  }
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:28,代码来源:Plot.cpp

示例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();
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:55,代码来源:Plot.cpp

示例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;
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:87,代码来源:MarkerSell.cpp

示例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;
          }
//.........这里部分代码省略.........
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:101,代码来源:MarkerRetracement.cpp


注:本文中的Marker::isSelected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。