本文整理汇总了C++中PropertyEditor::getCommandString方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyEditor::getCommandString方法的具体用法?C++ PropertyEditor::getCommandString怎么用?C++ PropertyEditor::getCommandString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyEditor
的用法示例。
在下文中一共展示了PropertyEditor::getCommandString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: helpFile
//.........这里部分代码省略.........
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")
m_showOtherSlice = pair.first.toBool();
else if (keys[ik] == "tfset")
m_tfset = pair.first.toInt();
else if (keys[ik] == "thickness")
m_thickness = pair.first.toInt();
else if (keys[ik] == "viewport scale")
m_viewportScale = pair.first.toDouble();
else if (keys[ik] == "camera type")
m_viewportType = (pair.first.toInt() == 1);
else if (keys[ik] == "stereo")
m_stereo = pair.first.toDouble();
else if (keys[ik] == "viewport")
{
vpstr = pair.first.toString();
QStringList list = vpstr.split(" ", QString::SkipEmptyParts);
if (list.count() == 4)
{
float x = list[0].toFloat();
float y = list[1].toFloat();
float z = list[2].toFloat();
float w = list[3].toFloat();
if (x < 0.0f || x > 1.0f ||
y < 0.0f || y > 1.0f ||
z < 0.0f || z > 1.0f ||
w < 0.0f || w > 1.0f)
QMessageBox::information(0, "",
QString("Values for viewport must be between 0.0 and 1.0 : %1 %2 %3 %4").\
arg(x).arg(y).arg(z).arg(w));
else
m_viewport = QVector4D(x,y,z,w);
}
else if (list.count() == 3)
{
float x = list[0].toFloat();
float y = list[1].toFloat();
float z = list[2].toFloat();
if (x < 0.0f || x > 1.0f ||
y < 0.0f || y > 1.0f ||
z < 0.0f || z > 1.0f)
QMessageBox::information(0, "",
QString("Values for viewport must be between 0.0 and 1.0 : %1 %2 %3").\
arg(x).arg(y).arg(z));
else
m_viewport = QVector4D(x,y,z,z);
}
else if (list.count() == 2)
{
float x = list[0].toFloat();
float y = list[1].toFloat();
if (x < 0.0f || x > 1.0f ||
y < 0.0f || y > 1.0f)
QMessageBox::information(0, "",
QString("Values for viewport must be between 0.0 and 1.0 : %1 %2").\
arg(x).arg(y));
else
m_viewport = QVector4D(x,y,0.5,0.5);
}
else
{
QMessageBox::information(0, "", "Switching off the viewport");
m_viewport = QVector4D(-1,-1,-1,-1);
}
}
}
}
QString cmd = propertyEditor.getCommandString();
if (!cmd.isEmpty())
return processCommand(cmd);
else
return true;
// if (propertyEditor.exec() == QDialog::Accepted)
// {
// QString cmd = propertyEditor.getCommandString();
// if (!cmd.isEmpty())
// return processCommand(cmd);
// }
// else
// return true;
}
示例2: if
//.........这里部分代码省略.........
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());
else if (keys[ik] == "animate")
m_paths[i]->setAnimate(pair.first.toBool());
else if (keys[ik] == "interpolate")
m_paths[i]->setAllowInterpolate(pair.first.toBool());
else if (keys[ik] == "animation speed")
m_paths[i]->setAnimateSpeed(pair.first.toInt());
else if (keys[ik] == "cap style")
m_paths[i]->setCapType(pair.first.toInt());
else if (keys[ik] == "arrow direction")
m_paths[i]->setArrowDirection(pair.first.toInt());
else if (keys[ik] == "arrows for all")
m_paths[i]->setArrowForAll(pair.first.toBool());
else if (keys[ik] == "same for all")
{
m_sameForAll = pair.first.toBool();
m_paths[i]->setSameForAll(m_sameForAll);
}
else if (keys[ik] == "clip")
m_paths[i]->setClip(pair.first.toBool());
else if (keys[ik] == "allow editing")
m_paths[i]->setAllowEditing(pair.first.toBool());
else if (keys[ik] == "blend with volume")
m_paths[i]->setBlendMode(pair.first.toBool());
else if (keys[ik] == "filter on length")
m_paths[i]->setFilterPathLen(pair.first.toBool());
else if (keys[ik] == "length bounds")
{
QString vstr = pair.first.toString();
QStringList vl = vstr.split(" ", QString::SkipEmptyParts);
if (vl.count() == 2)
m_paths[i]->setUserPathlenMinmax(vl[0].toDouble(),
vl[1].toDouble());
}
}
}
QString cmd = propertyEditor.getCommandString();
if (!cmd.isEmpty())
processCommand(i, cmd);
updateGL();
}
}
}
return true;
}
示例3: 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;
}