本文整理汇总了C++中PrefDialog::getItem方法的典型用法代码示例。如果您正苦于以下问题:C++ PrefDialog::getItem方法的具体用法?C++ PrefDialog::getItem怎么用?C++ PrefDialog::getItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrefDialog
的用法示例。
在下文中一共展示了PrefDialog::getItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: indicatorPrefDialog
//.........这里部分代码省略.........
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;
case TA_OUT_DASH_LINE:
ts = QString::number(PlotLine::Dash);
break;
case TA_OUT_HISTO:
ts = QString::number(PlotLine::Histogram);
break;
default:
ts = QString::number(PlotLine::Line);
break;
}
dialog->addComboItem(s, pl, lineTypes, ts.toInt());
parms.setData(s, ts);
}
else
dialog->addComboItem(s, pl, lineTypes, parms.getInt(s));
}
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
QStringList l;
parms.getKeyList(l);
int loop;
for (loop = 0; loop < (int) l.count(); loop++)
{
QString s;
dialog->getItem(l[loop], s);
if (s.length())
parms.setData(l[loop], s);
}
rc = TRUE;
}
else
rc = FALSE;
delete dialog;
return rc;
}