本文整理汇总了C++中PropertyEditor::exec方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyEditor::exec方法的具体用法?C++ PropertyEditor::exec怎么用?C++ PropertyEditor::exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyEditor
的用法示例。
在下文中一共展示了PropertyEditor::exec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: helpFile
void
PreferencesWidget::showHelp()
{
PropertyEditor propertyEditor;
QMap<QString, QVariantList> plist;
QVariantList vlist;
vlist.clear();
QFile helpFile(":/preferences.help");
if (helpFile.open(QFile::ReadOnly))
{
QTextStream in(&helpFile);
QString line = in.readLine();
while (!line.isNull())
{
if (line == "#begin")
{
QString keyword = in.readLine();
QString helptext;
line = in.readLine();
while (!line.isNull())
{
helptext += line;
helptext += "\n";
line = in.readLine();
if (line == "#end") break;
}
vlist << keyword << helptext;
}
line = in.readLine();
}
}
plist["commandhelp"] = vlist;
QStringList keys;
keys << "commandhelp";
propertyEditor.set("Preferences Help", plist, keys);
propertyEditor.exec();
}
示例2: if
//.........这里部分代码省略.........
keys << "depthcue";
keys << "gap";
keys << "filter on length";
keys << "length bounds";
keys << "scale type";
keys << "gap";
keys << "smoothness";
keys << "sections";
keys << "sparseness";
keys << "screen separation";
keys << "gap";
keys << "cap style";
keys << "arrow direction";
keys << "arrows for all";
keys << "gap";
keys << "animate";
keys << "interpolate";
keys << "animation speed";
keys << "gap";
keys << "same for all";
keys << "clip";
keys << "blend with volume";
keys << "allow editing";
keys << "command";
keys << "commandhelp";
keys << "message";
propertyEditor.set("Path Group Parameters", plist, keys);
QMap<QString, QPair<QVariant, bool> > vmap;
if (propertyEditor.exec() == QDialog::Accepted)
vmap = propertyEditor.get();
else
return true;
keys = vmap.keys();
for(int ik=0; ik<keys.count(); ik++)
{
QPair<QVariant, bool> pair = vmap.value(keys[ik]);
if (pair.second)
{
if (keys[ik] == "color")
{
QGradientStops stops = propertyEditor.getGradientStops(keys[ik]);
m_paths[i]->setStops(stops);
}
else if (keys[ik] == "opacity")
m_paths[i]->setOpacity(pair.first.toDouble());
else if (keys[ik] == "scale type")
m_paths[i]->setScaleType(pair.first.toBool());
else if (keys[ik] == "sections")
m_paths[i]->setSections(pair.first.toInt());
else if (keys[ik] == "smoothness")
m_paths[i]->setSegments(pair.first.toInt());
else if (keys[ik] == "sparseness")
m_paths[i]->setSparseness(pair.first.toInt());
else if (keys[ik] == "screen separation")
m_paths[i]->setSeparation(pair.first.toInt());
else if (keys[ik] == "depthcue")
m_paths[i]->setDepthcue(pair.first.toBool());
示例3: helpFile
//.........这里部分代码省略.........
vlist << mesg;
plist["message"] = vlist;
//---------------------
QStringList keys;
keys << "apply clipping";
keys << "solid color";
keys << "show slice";
keys << "show thickness";
keys << "show other slice";
keys << "gap";
keys << "color";
keys << "opacity";
keys << "gap";
keys << "viewport";
keys << "tfset";
keys << "thickness";
keys << "viewport scale";
keys << "camera type";
keys << "stereo";
keys << "gap";
keys << "command";
keys << "commandhelp";
keys << "message";
propertyEditor.set("Clip Plane Dialog", plist, keys);
QMap<QString, QPair<QVariant, bool> > vmap;
if (propertyEditor.exec() == QDialog::Accepted)
vmap = propertyEditor.get();
else
return true;
keys = vmap.keys();
for(int ik=0; ik<keys.count(); ik++)
{
QPair<QVariant, bool> pair = vmap.value(keys[ik]);
if (pair.second)
{
if (keys[ik] == "color")
{
QColor color = pair.first.value<QColor>();
float r = color.redF();
float g = color.greenF();
float b = color.blueF();
m_color = Vec(r,g,b);
}
else if (keys[ik] == "opacity")
m_opacity = pair.first.toDouble();
else if (keys[ik] == "solid color")
m_solidColor = pair.first.toBool();
else if (keys[ik] == "apply clipping")
m_apply = pair.first.toBool();
else if (keys[ik] == "show slice")
m_showSlice = pair.first.toBool();
else if (keys[ik] == "show thickness")
m_showThickness = pair.first.toBool();
else if (keys[ik] == "show other slice")
示例4: helpFile
//.........这里部分代码省略.........
vlist.clear();
QFile helpFile(":/mesh.help");
if (helpFile.open(QFile::ReadOnly))
{
QTextStream in(&helpFile);
QString line = in.readLine();
while (!line.isNull())
{
if (line == "#begin")
{
QString keyword = in.readLine();
QString helptext;
line = in.readLine();
while (!line.isNull())
{
helptext += line;
helptext += "\n";
line = in.readLine();
if (line == "#end") break;
}
vlist << keyword << helptext;
}
line = in.readLine();
}
}
plist["commandhelp"] = vlist;
vlist.clear();
QString mesg;
mesg += "File : "+m_vfm->fileName()+"\n";
int d = m_vfm->depth();
int w = m_vfm->width();
int h = m_vfm->height();
mesg += QString("Volume Size : %1 %2 %3\n").arg(h).arg(w).arg(d);
mesg += QString("Data Min : %1 %2 %3\n").arg(m_dataMin.x).arg(m_dataMin.y).arg(m_dataMin.z);
mesg += QString("Data Max : %1 %2 %3\n").arg(m_dataMax.x).arg(m_dataMax.y).arg(m_dataMax.z);
if (m_voxelType > 0)
mesg += "\n ** Only opacity based surface generation available for unsigned short data **\n";
mesg += "\n* You can keep on working while this process is running.\n";
vlist << mesg;
plist["message"] = vlist;
QStringList keys;
keys << "average color";
keys << "apply tag colors";
keys << "mop channel";
keys << "isosurface value";
keys << "depth";
keys << "fillvalue";
keys << "scale";
keys << "greater";
keys << "look inside";
keys << "color gradient";
keys << "commandhelp";
keys << "message";
propertyEditor.set("Mesh Repainting Parameters", plist, keys);
QMap<QString, QPair<QVariant, bool> > vmap;
if (propertyEditor.exec() == QDialog::Accepted)
vmap = propertyEditor.get();
else
return false;
for(int ik=0; ik<keys.count(); ik++)
{
QPair<QVariant, bool> pair = vmap.value(keys[ik]);
if (pair.second)
{
if (keys[ik] == "average color")
avgColor = pair.first.toBool();
else if (keys[ik] == "apply tag colors")
m_useTagColors = pair.first.toBool();
else if (keys[ik] == "mop channel")
chan = pair.first.toInt();
else if (keys[ik] == "color gradient")
vstops = propertyEditor.getGradientStops(keys[ik]);
else if (keys[ik] == "scale")
m_scaleModel = pair.first.toFloat();
else if (keys[ik] == "depth")
depth = pair.first.toInt();
else if (keys[ik] == "fillvalue")
fillValue = pair.first.toInt();
else if (keys[ik] == "greater")
checkForMore = pair.first.toBool();
else if (keys[ik] == "look inside")
lookInside = pair.first.toBool();
}
}
stops = resampleGradientStops(vstops);
return true;
}
示例5: if
//.........这里部分代码省略.........
vlist << QVariant("double");
vlist << QVariant(m_grids[i]->opacity());
vlist << QVariant(0.0);
vlist << QVariant(1.0);
vlist << QVariant(0.1); // singlestep
vlist << QVariant(1); // decimals
plist["opacity"] = vlist;
vlist.clear();
vlist << QVariant("color");
Vec pcolor = m_grids[i]->color();
QColor dcolor = QColor::fromRgbF(pcolor.x,
pcolor.y,
pcolor.z);
vlist << dcolor;
plist["color"] = vlist;
vlist.clear();
plist["command"] = vlist;
vlist.clear();
QFile helpFile(":/grids.help");
if (helpFile.open(QFile::ReadOnly))
{
QTextStream in(&helpFile);
QString line = in.readLine();
while (!line.isNull())
{
if (line == "#begin")
{
QString keyword = in.readLine();
QString helptext;
line = in.readLine();
while (!line.isNull())
{
helptext += line;
helptext += "\n";
line = in.readLine();
if (line == "#end") break;
}
vlist << keyword << helptext;
}
line = in.readLine();
}
}
plist["commandhelp"] = vlist;
QStringList keys;
keys << "color";
keys << "opacity";
keys << "gap";
keys << "command";
keys << "commandhelp";
propertyEditor.set("Grid Parameters", plist, keys);
QMap<QString, QPair<QVariant, bool> > vmap;
if (propertyEditor.exec() == QDialog::Accepted)
vmap = propertyEditor.get();
else
return true;
keys = vmap.keys();
for(int ik=0; ik<keys.count(); ik++)
{
QPair<QVariant, bool> pair = vmap.value(keys[ik]);
if (pair.second)
{
if (keys[ik] == "color")
{
QColor color = pair.first.value<QColor>();
float r = color.redF();
float g = color.greenF();
float b = color.blueF();
pcolor = Vec(r,g,b);
m_grids[i]->setColor(pcolor);
}
else if (keys[ik] == "opacity")
m_grids[i]->setOpacity(pair.first.toDouble());
}
}
QString cmd = propertyEditor.getCommandString();
if (!cmd.isEmpty())
processCommand(i, cmd);
emit updateGL();
}
}
}
return true;
}