本文整理汇总了C++中PrefDialog::getInt方法的典型用法代码示例。如果您正苦于以下问题:C++ PrefDialog::getInt方法的具体用法?C++ PrefDialog::getInt怎么用?C++ PrefDialog::getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrefDialog
的用法示例。
在下文中一共展示了PrefDialog::getInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: formatDialog
void BARS::formatDialog (QStringList &, QString &rv, QString &rs)
{
rs.truncate(0);
rv.truncate(0);
bool ok;
method = QInputDialog::getItem(QObject::tr("BARS Method Selection"),
QObject::tr("Select a method:"),
methodList,
0,
TRUE,
&ok,
0);
if (! ok)
return;
QString pl = QObject::tr("Parms");
QString vnl = QObject::tr("Variable Name");
QString cl = QObject::tr("Color");
QString rl = QObject::tr("Reversal");
PrefDialog *dialog = new PrefDialog(0);
dialog->setCaption(QObject::tr("BARS Format"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
QString s;
dialog->addTextItem(vnl, pl, s);
if (! method.compare("HACandle"))
dialog->addColorItem(cl, pl, candleColor);
if (! method.compare("PF"))
dialog->addIntItem(rl, pl, pfReversal);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getText(vnl, rv);
rs = method;
if (! method.compare("HACandle"))
{
dialog->getColor(cl, candleColor);
rs.append("," + candleColor.name());
}
if (! method.compare("PF"))
{
pfReversal = dialog->getInt(rl);
rs.append("," + QString::number(pfReversal));
}
}
delete dialog;
}
示例3: 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);
maType = dialog->getComboIndex(matl);
maInput = (BarData::InputType) dialog->getComboIndex(mail);
dialog->getColor(ma2cl, maColor2);
maLineType2 = (PlotLine::LineType) dialog->getComboIndex(ma2ltl);
maPeriod2 = dialog->getInt(ma2pl);
dialog->getText(ma2ll, maLabel2);
maType2 = dialog->getComboIndex(ma2tl);
maInput2 = (BarData::InputType) dialog->getComboIndex(ma2il);
dialog->getColor(ma3cl, maColor3);
maLineType3 = (PlotLine::LineType) dialog->getComboIndex(ma3ltl);
maPeriod3 = dialog->getInt(ma3pl);
dialog->getText(ma3ll, maLabel3);
maType3 = dialog->getComboIndex(ma3tl);
maInput3 = (BarData::InputType) dialog->getComboIndex(ma3il);
dialog->getColor(ma4cl, maColor4);
maLineType4 = (PlotLine::LineType) dialog->getComboIndex(ma4ltl);
maPeriod4 = dialog->getInt(ma4pl);
dialog->getText(ma4ll, maLabel4);
maType4 = dialog->getComboIndex(ma4tl);
maInput4 = (BarData::InputType) dialog->getComboIndex(ma4il);
}
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}
示例4: 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;
}
示例5: indicatorPrefDialog
int ExScript::indicatorPrefDialog (QWidget *w)
{
QString pl2 = QObject::tr("Output");
QString cl = QObject::tr("Color");
QString ll = QObject::tr("Label");
QString ltl = QObject::tr("Line Type");
QString spl = QObject::tr("Script Path");
QString clsl = QObject::tr("Switches");
QString pl = QObject::tr("Input");
QString dl = QObject::tr("Date");
QString ol = QObject::tr("Open");
QString hl = QObject::tr("High");
QString lol = QObject::tr("Low");
QString cll = QObject::tr("Close");
QString vl = QObject::tr("Volume");
QString oil = QObject::tr("Open Interest");
QString tol = QObject::tr("Timeout Seconds");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("ExScript Indicator"));
dialog->setHelpFile(helpFile);
dialog->createPage (pl);
QStringList l;
l.append(scriptPath);
dialog->addFileItem(spl, pl, l, scriptPath);
dialog->addTextItem(clsl, pl, comlineParms);
dialog->addIntItem(tol, pl, seconds, 1, 999);
dialog->addCheckItem(dl, pl, dateFlag);
dialog->addCheckItem(ol, pl, openFlag);
dialog->addCheckItem(hl, pl, highFlag);
dialog->addCheckItem(lol, pl, lowFlag);
dialog->addCheckItem(cll, pl, closeFlag);
dialog->addCheckItem(vl, pl, volumeFlag);
dialog->addCheckItem(oil, pl, oiFlag);
dialog->createPage(pl2);
dialog->addColorItem(cl, pl2, color);
dialog->addTextItem(ll, pl2, label);
dialog->addComboItem(ltl, pl2, lineTypes, lineType);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getFile(spl, l);
if (l.count())
scriptPath = l[0];
dialog->getText(clsl, comlineParms);
seconds = dialog->getInt(tol);
dateFlag = dialog->getCheck(dl);
openFlag = dialog->getCheck(ol);
highFlag = dialog->getCheck(hl);
lowFlag = dialog->getCheck(lol);
closeFlag = dialog->getCheck(cll);
volumeFlag = dialog->getCheck(vl);
oiFlag = dialog->getCheck(oil);
dialog->getColor(cl, color);
dialog->getText(ll, label);
lineType = (PlotLine::LineType) dialog->getComboIndex(ltl);
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}
示例6: indicatorPrefDialog
int THERM::indicatorPrefDialog (QWidget *w)
{
QString pl = QObject::tr("THERM Parms");
QString pl2 = QObject::tr("MA Parms");
QString cal = QObject::tr("Color Above MA");
QString cbl = QObject::tr("Color Below MA");
QString ctl = QObject::tr("Color Threshold");
QString ll = QObject::tr("Label");
QString tl = QObject::tr("Threshold");
QString sl = QObject::tr("Smoothing");
QString stl = QObject::tr("Smoothing Type");
QString mcl = QObject::tr("MA Color");
QString mltl = QObject::tr("MA Line Type");
QString mll = QObject::tr("MA Label");
QString mpl = QObject::tr("MA Period");
QString mtl = QObject::tr("MA Type");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("THERM Indicator"));
dialog->setHelpFile(helpFile);
dialog->createPage (pl);
dialog->addColorItem(cal, pl, upColor);
dialog->addColorItem(cbl, pl, downColor);
dialog->addColorItem(ctl, pl, threshColor);
dialog->addTextItem(ll, pl, label);
dialog->addDoubleItem(tl, pl, threshold, 1, 99999999);
dialog->addIntItem(sl, pl, smoothing, 0, 99999999);
QStringList l;
getMATypes(l);
dialog->addComboItem(stl, pl, l, smoothType);
dialog->createPage (pl2);
dialog->addColorItem(mcl, pl2, maColor);
dialog->addComboItem(mltl, pl2, lineTypes, maLineType);
dialog->addTextItem(mll, pl2, maLabel);
dialog->addIntItem(mpl, pl2, maPeriod, 0, 99999999);
dialog->addComboItem(mtl, pl2, l, maType);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getColor(cal, upColor);
dialog->getColor(cbl, downColor);
dialog->getColor(ctl, threshColor);
dialog->getText(ll, label);
threshold = dialog->getDouble(tl);
smoothing = dialog->getInt(sl);
smoothType = dialog->getComboIndex(stl);
dialog->getColor(mcl, maColor);
maLineType = (PlotLine::LineType) dialog->getComboIndex(mltl);
dialog->getText(mll, maLabel);
maPeriod = dialog->getInt(mpl);
maType = dialog->getComboIndex(mtl);
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}