本文整理汇总了C++中PrefDialog::getCombo方法的典型用法代码示例。如果您正苦于以下问题:C++ PrefDialog::getCombo方法的具体用法?C++ PrefDialog::getCombo怎么用?C++ PrefDialog::getCombo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrefDialog
的用法示例。
在下文中一共展示了PrefDialog::getCombo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: editPlotItem
void FormulaEdit::editPlotItem ()
{
QString s = plot->currentText();
if (! s.length())
return;
s.remove(0, s.find("(", 0, TRUE) + 1);
s.truncate(s.find(")", -1, TRUE));
QStringList l = QStringList::split(",", s, FALSE);
int loop;
for (loop = 0; loop < (int) l.count(); loop++)
l[loop] = l[loop].stripWhiteSpace();
QString pl = tr("Plot");
QString cl = tr("Color");
QString ll = tr("Label");
QString ltl = tr("Line Type");
QString vl = tr("Variable");
PrefDialog *dialog = new PrefDialog(this);
dialog->setCaption(tr("Edit Plot"));
dialog->createPage (pl);
s = "Var";
QStringList l2;
getVariableList(l2, FALSE);
dialog->addComboItem(vl, pl, l2, l[0]);
QColor c(l[1]);
dialog->addColorItem(cl, pl, c);
dialog->addTextItem(ll, pl, l[2]);
l2 = lineTypes;
dialog->addComboItem(ltl, pl, l2, l[3]);
int rc = dialog->exec();
if (rc != QDialog::Accepted)
{
delete dialog;
return;
}
QString ts;
s = "plot (";
dialog->getCombo(vl, ts);
s.append(ts + ",");
dialog->getColor(cl, c);
s.append(c.name() + ",");
dialog->getText(ll, ts);
if (! ts.length())
ts = " ";
s.append(ts + ",");
dialog->getCombo(ltl, ts);
s.append(ts + ")");
plot->changeItem(s, plot->currentItem());
delete dialog;
}
示例2: formatDialog
void THERM::formatDialog (QStringList &, QString &rv, QString &rs)
{
rs.truncate(0);
rv.truncate(0);
QString pl = QObject::tr("Parms");
QString vnl = QObject::tr("Variable Name");
QString tl = QObject::tr("Threshold");
QString sl = QObject::tr("Smoothing");
QString stl = QObject::tr("Smoothing Type");
QString mpl = QObject::tr("MA Period");
QString mtl = QObject::tr("MA Type");
PrefDialog *dialog = new PrefDialog(0);
dialog->setCaption(QObject::tr("THERM Format"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
QString s;
QStringList l;
getMATypes(l);
dialog->addTextItem(vnl, pl, s);
dialog->addComboItem(mtl, pl, l, maType);
dialog->addIntItem(mpl, pl, maPeriod, 0, 99999999);
dialog->addDoubleItem(tl, pl, threshold, 1, 99999999);
dialog->addComboItem(stl, pl, l, smoothType);
dialog->addIntItem(sl, pl, smoothing, 0, 99999999);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getText(vnl, rv);
dialog->getCombo(mtl, rs);
int t = dialog->getInt(mpl);
rs.append("," + QString::number(t));
double d = dialog->getDouble(tl);
rs.append("," + QString::number(d));
dialog->getCombo(stl, s);
rs.append("," + s);
t = dialog->getInt(sl);
rs.append("," + QString::number(t));
}
delete dialog;
}
示例3: formatDialog
void PP::formatDialog (QStringList &, QString &rv, QString &rs)
{
rs.truncate(0);
rv.truncate(0);
QString pl = QObject::tr("Parms");
QString vnl = QObject::tr("Variable Name");
QString ppl = QObject::tr("PP Level");
PrefDialog *dialog = new PrefDialog(0);
dialog->setCaption(QObject::tr("PP Format"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
QString s;
dialog->addTextItem(vnl, pl, s);
dialog->addComboItem(ppl, pl, ppList, 0);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getText(vnl, rv);
dialog->getCombo(ppl, rs);
}
delete dialog;
}
示例4: insertPlotItem
void FormulaEdit::insertPlotItem ()
{
QString pl = tr("Plot");
QString cl = tr("Color");
QString ll = tr("Label");
QString ltl = tr("Line Type");
QString vl = tr("Variable");
PrefDialog *dialog = new PrefDialog(this);
dialog->setCaption(tr("Insert Plot"));
dialog->createPage (pl);
QString s("Var");
QStringList l;
getVariableList(l, FALSE);
dialog->addComboItem(vl, pl, l, 0);
QColor c("red");
dialog->addColorItem(cl, pl, c);
s = "Label";
dialog->addTextItem(ll, pl, s);
dialog->addComboItem(ltl, pl, lineTypes, 4);
int rc = dialog->exec();
if (rc != QDialog::Accepted)
{
delete dialog;
return;
}
QString ts;
s = "plot (";
dialog->getCombo(vl, ts);
s.append(ts + ",");
dialog->getColor(cl, c);
s.append(c.name() + ",");
dialog->getText(ll, ts);
if (! ts.length())
ts = " ";
s.append(ts + ",");
dialog->getCombo(ltl, ts);
s.append(ts + ")");
plot->insertItem(s, plot->currentItem() + 1);
delete dialog;
}
示例5: formatDialog
void LOWPASS::formatDialog (QStringList &vl, QString &rv, QString &rs)
{
rs.truncate(0);
rv.truncate(0);
QString pl = QObject::tr("Parms");
QString vnl = QObject::tr("Variable Name");
QString fl = QObject::tr("Freq");
QString wl = QObject::tr("Width");
QString il = QObject::tr("Input");
PrefDialog *dialog = new PrefDialog(0);
dialog->setCaption(QObject::tr("LOWPASS Format"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
QString s;
dialog->addTextItem(vnl, pl, s);
dialog->addComboItem(il, pl, vl, input);
dialog->addDoubleItem(fl, pl, freq, 0, 0.5);
dialog->addDoubleItem(wl, pl, width, 0.0001, 0.2);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getText(vnl, rv);
dialog->getCombo(il, s);
rs.append(s + ",");
double t = dialog->getDouble(fl);
rs.append(QString::number(t) + ",");
t = dialog->getDouble(wl);
rs.append(QString::number(t));
}
delete dialog;
}
示例6: indicatorPrefDialog
//.........这里部分代码省略.........
dialog->addComboItem(ma3il, pl4, inputTypeList, maInput3);
dialog->createPage (pl5);
dialog->addColorItem(ma4cl, pl5, maColor4);
dialog->addTextItem(ma4ll, pl5, maLabel4);
dialog->addComboItem(ma4ltl, pl5, lineTypes, maLineType4);
dialog->addComboItem(ma4tl, pl5, mal, maType4);
dialog->addIntItem(ma4pl, pl5, maPeriod4, 1, 999999);
dialog->addComboItem(ma4il, pl5, inputTypeList, maInput4);
}
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
if (! method.compare("OHLC"))
{
dialog->getColor(ucl, barUpColor);
dialog->getColor(dcl, barDownColor);
dialog->getColor(ncl, barNeutralColor);
lineType = PlotLine::Bar;
}
if (! method.compare("Candle") || ! method.compare("HACandle"))
{
dialog->getColor(ucl, barUpColor);
dialog->getColor(dcl, barDownColor);
dialog->getColor(ncl, barNeutralColor);
lineType = PlotLine::Candle;
}
if (! method.compare("PF"))
{
dialog->getCombo(pfml, pfMethod);
dialog->getColor(pfxcl, pfXColor);
dialog->getColor(pfocl, pfOColor);
pfReversal = dialog->getInt(pfrl);
if (! pfMethod.compare(QObject::tr("Custom")) && data)
{
double d = dialog->getDouble(pfbsl);
QString s;
Config config;
config.getData(Config::CurrentChart, s);
QFileInfo fi(s);
s = fi.fileName();
DBBase db;
if (! db.open(dbPath))
{
QString s2 = QString::number(d) + "," + QString::number(pfReversal);
db.setData(s, s2);
db.close();
}
}
lineType = PlotLine::PF;
}
dialog->getText(ll, label);
if (! method.compare("OHLC") || ! method.compare("Candle") || ! method.compare("HACandle"))
{
dialog->getColor(macl, maColor);
maLineType = (PlotLine::LineType) dialog->getComboIndex(maltl);
maPeriod = dialog->getInt(mapl);
dialog->getText(mall, maLabel);
示例7: 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;
}
示例8: formatDialog
//.........这里部分代码省略.........
break;
default:
break;
}
}
QStringList mal;
getMATypes(mal);
mal.remove("Wilder");
// get the input parms
const TA_OptInputParameterInfo *optInfo;
for (loop = 0; loop < (int) theInfo->nbOptInput; loop++ )
{
TA_GetOptInputParameterInfo(theInfo->handle, loop, &optInfo);
s = optInfo->displayName;
switch (optInfo->type)
{
case TA_OptInput_RealRange:
dialog->addDoubleItem(s, pl, (double) optInfo->defaultValue, 0, 99999999);
break;
case TA_OptInput_IntegerRange:
dialog->addIntItem(s, pl, (int) optInfo->defaultValue, 1, 999999);
break;
case TA_OptInput_IntegerList:
dialog->addComboItem(s, pl, mal, (int) optInfo->defaultValue);
break;
case TA_OptInput_RealList:
break;
default:
break;
}
}
if (theInfo->nbOutput > 1)
{
s = "Plot";
dialog->addIntItem(s, pl, 1, 1, theInfo->nbOutput);
}
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getText(vnl, rv);
rs = formatMethod;
QString ts;
for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
{
s = QObject::tr("Input") + QString::number(loop + 1);
TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
switch (inputParms->type)
{
case TA_Input_Real:
dialog->getCombo(s, ts);
rs.append("," + ts);
break;
default:
break;
}
}
double d = 0;
int t = 0;
for (loop = 0; loop < (int) theInfo->nbOptInput; loop++ )
{
TA_GetOptInputParameterInfo(theInfo->handle, loop, &optInfo);
s = optInfo->displayName;
switch (optInfo->type)
{
case TA_OptInput_RealRange:
d = dialog->getDouble(s);
rs.append("," + QString::number(d));
break;
case TA_OptInput_IntegerRange:
t = dialog->getInt(s);
rs.append("," + QString::number(t));
break;
case TA_OptInput_IntegerList:
dialog->getCombo(s, ts);
rs.append("," + ts);
break;
case TA_OptInput_RealList:
break;
default:
break;
}
}
if (theInfo->nbOutput > 1)
{
s = "Plot";
t = dialog->getInt(s);
rs.append("," + QString::number(t));
}
}
delete dialog;
}