本文整理汇总了C++中DBIndexItem::setType方法的典型用法代码示例。如果您正苦于以下问题:C++ DBIndexItem::setType方法的具体用法?C++ DBIndexItem::setType怎么用?C++ DBIndexItem::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBIndexItem
的用法示例。
在下文中一共展示了DBIndexItem::setType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNewFutures
bool DbPlugin::createNewFutures ()
{
QString s;
DBIndexItem item;
chartIndex->getIndexItem(indexKey, item);
item.getSymbol(s);
if (s.length())
{
qDebug("DbPlugin::createNewStock: duplicate symbol %s", s.latin1());
return TRUE;
}
type = Futures1;
FuturesData fd;
if (fd.setSymbolPath(symbol))
return TRUE;
s = "Futures";
item.setType(s);
fd.getName(s);
item.setTitle(s);
item.setSymbol(indexKey);
fd.getSymbol(s);
item.setFuturesType(s);
s = symbol.right(1);
item.setFuturesMonth(s);
chartIndex->setIndexItem(indexKey, item);
return FALSE;
}
示例2: createNewStock
bool DbPlugin::createNewStock ()
{
QString s;
DBIndexItem item;
chartIndex->getIndexItem(indexKey, item);
item.getSymbol(s);
if (s.length())
{
qDebug("DbPlugin::createNewStock: duplicate symbol %s", s.latin1());
return TRUE;
}
type = Stock1;
s = "Stock";
item.setType(s);
item.setTitle(indexKey);
item.setSymbol(indexKey);
chartIndex->setIndexItem(indexKey, item);
return FALSE;
}
示例3: createNewCC
bool DbPlugin::createNewCC (DBIndex *i)
{
FuturesData fd;
QStringList l;
fd.getSymbolList(l);
QString pl = QObject::tr("Parms");
QString fsl = QObject::tr("Futures Symbol");
QString gl = QObject::tr("Gapless");
PrefDialog *dialog = new PrefDialog(0);
dialog->setCaption(QObject::tr("New CC"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
dialog->addComboItem(fsl, pl, l, 0);
dialog->addCheckItem(gl, pl, TRUE);
int rc = dialog->exec();
if (rc != QDialog::Accepted)
{
delete dialog;
return TRUE;
}
QString sym;
dialog->getCombo(fsl, sym);
bool f = dialog->getCheck(gl);
delete dialog;
QDir dir;
Config config;
QString s;
config.getData(Config::DataPath, s);
s.append("/CC");
if (! dir.exists(s))
{
if (! dir.mkdir(s, TRUE))
{
QMessageBox::information(0,
QObject::tr("Qtstalker: Error"),
QObject::tr("Could not create ~/.qtstalker/data/CC directory."));
return TRUE;
}
}
DBIndexItem item;
QString ts;
chartIndex->getIndexItem(sym, item);
item.getSymbol(ts);
if (ts.length())
{
qDebug("DbPlugin::createNewStock: duplicate symbol %s", ts.latin1());
return TRUE;
}
s.append("/" + sym);
if (open(s, i))
{
QMessageBox::information(0,
QObject::tr("Qtstalker: Error"),
QObject::tr("Disk error, cannot create chart"));
return TRUE;
}
type = CC1;
item.setSymbol(sym);
s = "CC";
item.setType(s);
s = sym + " - " + QObject::tr("Continuous Adjusted");
item.setTitle(s);
chartIndex->setIndexItem(indexKey, item);
s = QString::number(f);
sym = "Adjustment";
setData(sym, s);
return FALSE;
}
示例4: createNewSpread
bool DbPlugin::createNewSpread (DBIndex *i)
{
bool ok = FALSE;
QString sn = QInputDialog::getText(QObject::tr("New Spread"),
QObject::tr("Enter symbol name for the new Spread"),
QLineEdit::Normal,
QString::null,
&ok,
0);
if (! sn.length() || ok == FALSE)
return TRUE;
QDir dir;
Config config;
QString s;
config.getData(Config::DataPath, s);
s.append("/Spread");
if (! dir.exists(s))
{
if (! dir.mkdir(s, TRUE))
{
QMessageBox::information(0, QObject::tr("Qtstalker: Error"), QObject::tr("Could not create Spread directory."));
return TRUE;
}
}
s.append("/" + sn);
if (dir.exists(s))
{
QMessageBox::information(0, QObject::tr("Qtstalker: Error"), QObject::tr("This Spread already exists."));
return TRUE;
}
DBIndexItem item;
QString ts;
chartIndex->getIndexItem(sn, item);
item.getSymbol(ts);
if (ts.length())
{
qDebug("DbPlugin::createNewStock: duplicate symbol %s", sn.latin1());
return TRUE;
}
if (open(s, i))
{
QMessageBox::information(0,
QObject::tr("Qtstalker: Error"),
QObject::tr("Disk error, cannot create chart"));
return TRUE;
}
type = Spread1;
item.setSymbol(indexKey);
s = "Spread";
item.setType(s);
item.setTitle(indexKey);
chartIndex->setIndexItem(indexKey, item);
spreadPref();
return FALSE;
}
示例5: saveHeaderData
void UpgradeMessage::saveHeaderData (DbPlugin &db, QString &k, QString &d, QString &sym, DBIndexItem &item)
{
// is this a co key?
bool ok = FALSE;
double t = k.toDouble(&ok);
if (ok)
{
if (t < 10000)
{
// its a chart object
Setting t;
t.parse(d);
QString s = "Plugin";
QString s2;
t.getData(s,s2);
if (s2.length())
{
t.remove(s);
s = "Type";
t.setData(s, s2);
}
s = "Plot";
t.getData(s, s2);
if (! s2.compare("Main Plot"))
{
s2 = "Bars";
t.setData(s, s2);
}
else
return;
index.setChartObject(sym, k, t);
return;
}
}
if (! k.compare("Type"))
{
item.setType(d);
return;
}
if (! k.compare("FuturesType"))
{
item.setFuturesType(d);
return;
}
if (! k.compare("FuturesMonth"))
{
item.setFuturesMonth(d);
return;
}
if (! k.compare("BarType"))
{
item.setBarType(d);
return;
}
if (! k.compare("Fundamentals"))
{
index.setFundamentals(sym, d);
return;
}
if (! k.compare("LocalIndicators"))
{
index.addIndicator(sym, d);
return;
}
if (! k.compare("QuotePlugin"))
{
item.setQuotePlugin(d);
return;
}
if (! k.compare("Symbol"))
{
item.setSymbol(d);
return;
}
if (! k.compare("Title"))
{
item.setTitle(d);
return;
}
if (! k.compare("Path"))
{
item.setPath(d);
return;
}
if (! k.compare("SpreadFirstSymbol"))
{
int t = d.find("/data0/", 0, TRUE);
//.........这里部分代码省略.........