本文整理汇总了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);
}
}
}
示例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;
}
示例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;
}
示例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;
}