本文整理汇总了C++中PrefDialog::addColorItem方法的典型用法代码示例。如果您正苦于以下问题:C++ PrefDialog::addColorItem方法的具体用法?C++ PrefDialog::addColorItem怎么用?C++ PrefDialog::addColorItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrefDialog
的用法示例。
在下文中一共展示了PrefDialog::addColorItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: indicatorPrefDialog
int PP::indicatorPrefDialog (QWidget *w)
{
QString pl = QObject::tr("Support");
QString scl = QObject::tr("Support Color");
QString lfsl = QObject::tr("Label First Support");
QString lssl = QObject::tr("Label Second Support");
QString ltsl = QObject::tr("Label Third Support");
QString pl2 = QObject::tr("Resistance");
QString rcl = QObject::tr("Resistance Color");
QString lfrl = QObject::tr("Label First Resistance");
QString lsrl = QObject::tr("Label Second Resistance");
QString ltrl = QObject::tr("Label Third Resistance");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("PP Indicator"));
dialog->setHelpFile(helpFile);
dialog->createPage (pl);
dialog->addColorItem(scl, pl, supColor);
dialog->addTextItem(lfsl, pl, supLabel);
dialog->addTextItem(lssl, pl, supLabel2);
dialog->addTextItem(ltsl, pl, supLabel3);
dialog->createPage (pl2);
dialog->addColorItem(rcl, pl2, resColor);
dialog->addTextItem(lfrl, pl2, resLabel);
dialog->addTextItem(lsrl, pl2, resLabel2);
dialog->addTextItem(ltrl, pl2, resLabel3);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getColor(scl, supColor);
dialog->getColor(rcl, resColor);
dialog->getText(lfsl, supLabel);
dialog->getText(lssl, supLabel2);
dialog->getText(ltsl, supLabel3);
dialog->getText(lfrl, resLabel);
dialog->getText(lsrl, resLabel2);
dialog->getText(ltrl, resLabel3);
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}
示例2: 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;
}
示例3: 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;
}
示例4: indicatorPrefDialog
int LOWPASS::indicatorPrefDialog (QWidget *w)
{
QString pl = QObject::tr("Parms");
QString cl = QObject::tr("Color");
QString ll = QObject::tr("Label");
QString ltl = QObject::tr("Line Type");
QString fl = QObject::tr("Freq");
QString wl = QObject::tr("Width");
QString il = QObject::tr("Input");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("LOWPASS Indicator"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
dialog->addColorItem(cl, pl, color);
dialog->addTextItem(ll, pl, label);
dialog->addComboItem(ltl, pl, lineTypes, lineType);
dialog->addComboItem(il, pl, inputTypeList, 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->getColor(cl, color);
lineType = (PlotLine::LineType) dialog->getComboIndex(ltl);
dialog->getText(ll, label);
input = (BarData::InputType) dialog->getComboIndex(il);
freq = dialog->getDouble(fl);
if (freq < 0.0)
freq = 0.0;
if (freq > 0.5)
freq = 0.5;
width = dialog->getDouble(wl);
if (width < 0.0001)
width = 0.0001;
if (width > 0.2)
width = 0.2;
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}
示例5: indicatorPrefDialog
int SINWAV::indicatorPrefDialog (QWidget *w)
{
QString pl = QObject::tr("Parms");
QString cl = QObject::tr("Sine Color");
QString c2 = QObject::tr("Lead Color");
QString ll = QObject::tr("Label");
QString ltl = QObject::tr("Sine Line Type");
QString lt2 = QObject::tr("Lead Line Type");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("SINWAV Indicator"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
dialog->addColorItem(cl, pl, colorSin);
dialog->addComboItem(ltl, pl, lineTypes, lineTypeSin);
dialog->addColorItem(c2, pl, colorLead);
dialog->addComboItem(lt2, pl, lineTypes, lineTypeLead);
dialog->addTextItem(ll, pl, labelSin);
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
dialog->getColor(cl, colorSin);
dialog->getColor(c2, colorLead);
lineTypeSin = (PlotLine::LineType) dialog->getComboIndex(ltl);
lineTypeLead = (PlotLine::LineType) dialog->getComboIndex(lt2);
dialog->getText(ll, labelSin);
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}
示例6: 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;
}
示例7: indicatorPrefDialog
int BARS::indicatorPrefDialog (QWidget *w)
{
bool newFlag = FALSE;
if (! method.length())
newFlag = TRUE;
if (newFlag)
{
bool ok;
QString s = QInputDialog::getItem(QObject::tr("BARS type Selection"),
QObject::tr("Select a bar type:"),
methodList,
0,
TRUE,
&ok,
w);
if (ok)
{
method = s;
label = method;
}
else
return FALSE;
}
QString pl = QObject::tr("Parms");
QString ucl = QObject::tr("Up Color");
QString dcl = QObject::tr("Down Color");
QString ncl = QObject::tr("Neutral Color");
QString ccl = QObject::tr("Candle Color");
QString ll = QObject::tr("Label");
QString pfxcl = QObject::tr("X Color");
QString pfocl = QObject::tr("O Color");
QString pfrl = QObject::tr("Reversal");
QString pfbsl = QObject::tr("Box Size");
QString pfml = QObject::tr("Method");
QString pl2 = QObject::tr("MA");
QString macl = QObject::tr("MA Color");
QString mall = QObject::tr("MA Label");
QString maltl = QObject::tr("MA Line Type");
QString mapl = QObject::tr("MA Period");
QString matl = QObject::tr("MA Type");
QString mail = QObject::tr("MA Input");
QString pl3 = QObject::tr("MA2");
QString ma2cl = QObject::tr("MA2 Color");
QString ma2ll = QObject::tr("MA2 Label");
QString ma2ltl = QObject::tr("MA2 Line Type");
QString ma2pl = QObject::tr("MA2 Period");
QString ma2tl = QObject::tr("MA2 Type");
QString ma2il = QObject::tr("MA2 Input");
QString pl4 = QObject::tr("MA3");
QString ma3cl = QObject::tr("MA3 Color");
QString ma3ll = QObject::tr("MA3 Label");
QString ma3ltl = QObject::tr("MA3 Line Type");
QString ma3pl = QObject::tr("MA3 Period");
QString ma3tl = QObject::tr("MA3 Type");
QString ma3il = QObject::tr("MA3 Input");
QString pl5 = QObject::tr("MA4");
QString ma4cl = QObject::tr("MA4 Color");
QString ma4ll = QObject::tr("MA4 Label");
QString ma4ltl = QObject::tr("MA4 Line Type");
QString ma4pl = QObject::tr("MA4 Period");
QString ma4tl = QObject::tr("MA4 Type");
QString ma4il = QObject::tr("MA4 Input");
PrefDialog *dialog = new PrefDialog(w);
dialog->setCaption(QObject::tr("BARS Indicator"));
dialog->createPage (pl);
dialog->setHelpFile(helpFile);
if (! method.compare("OHLC"))
{
dialog->setCaption(QObject::tr("OHLC Bars"));
dialog->addColorItem(ucl, pl, barUpColor);
dialog->addColorItem(dcl, pl, barDownColor);
dialog->addColorItem(ncl, pl, barNeutralColor);
}
if (! method.compare("Candle"))
{
dialog->setCaption(QObject::tr("Japanese Candlesticks"));
dialog->addColorItem(ucl, pl, barUpColor);
dialog->addColorItem(dcl, pl, barDownColor);
dialog->addColorItem(ncl, pl, barNeutralColor);
}
if (! method.compare("HACandle"))
{
dialog->setCaption(QObject::tr("Heiken Ashi Candlesticks"));
dialog->addColorItem(ucl, pl, barUpColor);
dialog->addColorItem(dcl, pl, barDownColor);
dialog->addColorItem(ncl, pl, barNeutralColor);
}
if (! method.compare("PF"))
//.........这里部分代码省略.........
示例8: indicatorPrefDialog
//.........这里部分代码省略.........
}
}
// setup the output plots
const TA_OutputParameterInfo *outInfo;
for (loop = 0; loop < (int) theInfo->nbOutput; loop++ )
{
TA_GetOutputParameterInfo(theInfo->handle, loop, &outInfo);
pl = outInfo->paramName;
pl = pl.right(pl.length() - 3);
if (! pl.left(4).compare("Real"))
pl = pl.right(pl.length() - 4);
if (! pl.left(7).compare("Integer"))
pl = pl.right(pl.length() - 7);
if (! pl.length())
pl = QObject::tr("Plot");
dialog->createPage (pl);
QString s = pl + " " + QObject::tr("Color");
QColor color;
if (loop == 0)
color.setNamedColor("red");
else
{
if (loop == 1)
color.setNamedColor("yellow");
else
color.setNamedColor("blue");
}
parms.getData(s, ts);
if (! ts.length())
{
dialog->addColorItem(s, pl, color);
ts = color.name();
parms.setData(s, ts);
}
else
{
parms.getData(s, ts);
color.setNamedColor(ts);
dialog->addColorItem(s, pl, color);
}
s = pl + " " + QObject::tr("Label");
parms.getData(s, ts);
if (! ts.length())
{
dialog->addTextItem(s, pl, pl);
parms.setData(s, pl);
}
else
{
parms.getData(s, ts);
dialog->addTextItem(s, pl, ts);
}
s = pl + " " + QObject::tr("Line Type");
parms.getData(s, ts);
if (! ts.length())
{
switch (outInfo->flags)
{
case TA_OUT_DOT_LINE:
ts = QString::number(PlotLine::Dot);
break;
示例9: 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;
}
示例10: 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;
}