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


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

本文整理汇总了C++中Marker::setModified方法的典型用法代码示例。如果您正苦于以下问题:C++ Marker::setModified方法的具体用法?C++ Marker::setModified怎么用?C++ Marker::setModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Marker的用法示例。


在下文中一共展示了Marker::setModified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pit

void
PlotWidget::saveMarkers (DataBase &db)
{
  // save plot markers
  QHashIterator<QString, Plot *> pit(_plots);
  while (pit.hasNext())
  {
    pit.next();
    Plot *p = pit.value();
    
    QHash<QString, Marker *> markers = p->markers();
    QHashIterator<QString, Marker *> mit(markers);
    while (mit.hasNext())
    {
      mit.next();
      Marker *m = mit.value();
    
      if (m->readOnly())
        continue;
      
      if (! m->modified())
        continue;
      
      Entity *e = m->settings();
      e->setName(mit.key());
      
      db.transaction();
      db.set(e);
      db.commit();
      
      m->setModified(FALSE);
    }
  }
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:34,代码来源:PlotWidget.cpp

示例2: switch

int
MarkerSell::move (PluginData *pd)
{
  if (! pd->data)
    return 0;
  
  Marker *sell = (Marker *) pd->data;
  
  switch (pd->status)
  {
    case PlotStatus::_MOVE:
    {
      Entity *e = sell->settings();
      
      QVariant *price = e->get(QString("price"));
      if (! price)
        return 0;

      QVariant *date = e->get(QString("date"));
      if (! date)
        return 0;
      
      QwtScaleMap map = sell->plot()->canvasMap(QwtPlot::xBottom);
      int x = map.invTransform((double) pd->point.x());

      if (! g_symbol)
        return 0;
      Bar *tbar = g_symbol->bar(x);
      if (! tbar)
        return 0;
      date->setValue(tbar->date());

      map = sell->plot()->canvasMap(QwtPlot::yRight);
      price->setValue(map.invTransform((double) pd->point.y()));
      
      sell->setModified(TRUE);

      sell->plot()->replot();
      break;
    }
    default:
      break;
  }
  
  return 1;
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:46,代码来源:MarkerSell.cpp

示例3: switch

int
MarkerRetracement::move (PluginData *pd)
{
  if (! pd->data)
    return 0;
  
  Marker *m = (Marker *) pd->data;
  
  Entity *e = m->settings();
  
  switch (pd->status)
  {
    case PlotStatus::_MOVE:
    case PlotStatus::_CREATE_MOVE:
    {
      QVariant *date = e->get(QString("date"));
      if (! date)
        return 0;
  
      QVariant *date2 = e->get(QString("date2"));
      if (! date2)
        return 0;

      QVariant *high = e->get(QString("high"));
      if (! high)
        return 0;

      QVariant *low = e->get(QString("low"));
      if (! low)
        return 0;
      
      QwtScaleMap map = m->plot()->canvasMap(QwtPlot::xBottom);
      int x = map.invTransform((double) pd->point.x());

      Bar *bar = g_symbol->bar(x);
      if (! bar)
        return 0;
      date->setValue(bar->date());

      map = m->plot()->canvasMap(QwtPlot::yRight);
      high->setValue(map.invTransform((double) pd->point.y()));

      if (pd->status == PlotStatus::_CREATE_MOVE)
      {
        date2->setValue(bar->date());
        low->setValue(high->toDouble());
      }

      m->plot()->replot();

      m->setModified(TRUE);
      break;
    }
    case PlotStatus::_MOVE2:
    {
      QVariant *date2 = e->get(QString("date2"));
      if (! date2)
        return 0;

      QVariant *low = e->get(QString("low"));
      if (! low)
        return 0;

      QwtScaleMap map = m->plot()->canvasMap(QwtPlot::xBottom);
      int x = map.invTransform((double) pd->point.x());

      Bar *bar = g_symbol->bar(x);
      if (! bar)
        return 0;
      date2->setValue(bar->date());

      map = m->plot()->canvasMap(QwtPlot::yRight);
      low->setValue(map.invTransform((double) pd->point.y()));

      m->plot()->replot();

      m->setModified(TRUE);
      break;
    }
    default:
      break;
  }
  
  return 1;
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:85,代码来源:MarkerRetracement.cpp

示例4: switch

int
MarkerTLine::move (PluginData *pd)
{
  if (! pd->data)
    return 0;
  
  Marker *tline = (Marker *) pd->data;
  
  Entity *e = tline->settings();
  
  switch (pd->status)
  {
    case PlotStatus::_MOVE:
    case PlotStatus::_CREATE_MOVE:
    {
      QVariant *price = e->get(QString("price"));
      if (! price)
        return 0;

      QVariant *date = e->get(QString("date"));
      if (! date)
        return 0;
  
      QVariant *price2 = e->get(QString("price2"));
      if (! price2)
        return 0;

      QVariant *date2 = e->get(QString("date2"));
      if (! date2)
        return 0;
      
      QwtScaleMap map = tline->plot()->canvasMap(QwtPlot::xBottom);
      int x = map.invTransform((double) pd->point.x());

      Bar *bar = g_symbol->bar(x);
      if (! bar)
        return 0;
      date->setValue(bar->date());

      map = tline->plot()->canvasMap(QwtPlot::yRight);
      price->setValue(map.invTransform((double) pd->point.y()));

      if (pd->status == PlotStatus::_CREATE_MOVE)
      {
        date2->setValue(bar->date());
        price2->setValue(price->toDouble());
      }

      tline->plot()->replot();

      tline->setModified(TRUE);
      break;
    }
    case PlotStatus::_MOVE2:
    {
      QVariant *price2 = e->get(QString("price2"));
      if (! price2)
        return 0;

      QVariant *date2 = e->get(QString("date2"));
      if (! date2)
        return 0;

      QwtScaleMap map = tline->plot()->canvasMap(QwtPlot::xBottom);
      int x = map.invTransform((double) pd->point.x());

      Bar *bar = g_symbol->bar(x);
      if (! bar)
        return 0;
      date2->setValue(bar->date());

      map = tline->plot()->canvasMap(QwtPlot::yRight);
      price2->setValue(map.invTransform((double) pd->point.y()));

      tline->plot()->replot();

      tline->setModified(TRUE);
      break;
    }
    default:
      break;
  }
  
  return 1;
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:85,代码来源:MarkerTLine.cpp


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