本文整理汇总了C++中PropertyEditor::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyEditor::get方法的具体用法?C++ PropertyEditor::get怎么用?C++ PropertyEditor::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyEditor
的用法示例。
在下文中一共展示了PropertyEditor::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
PathGroups::keyPressEvent(QKeyEvent *event)
{
for(int i=0; i<m_paths.count(); i++)
{
if (m_paths[i]->grabsMouse())
{
if (event->key() == Qt::Key_G)
{
m_paths[i]->removeFromMouseGrabberPool();
return true;
}
if (event->key() == Qt::Key_C)
{
bool b = m_paths[i]->closed();
m_paths[i]->setClosed(!b);
return true;
}
else if (event->key() == Qt::Key_P)
{
bool b = m_paths[i]->showPoints();
m_paths[i]->setShowPoints(!b);
return true;
}
else if (event->key() == Qt::Key_L)
{
bool b = m_paths[i]->showLength();
m_paths[i]->setShowLength(!b);
return true;
}
else if (event->key() == Qt::Key_X)
{
m_paths[i]->setMoveAxis(PathGroupGrabber::MoveX);
return true;
}
else if (event->key() == Qt::Key_Y)
{
if (event->modifiers() & Qt::ControlModifier ||
event->modifiers() & Qt::MetaModifier)
m_paths[i]->redo();
else
m_paths[i]->setMoveAxis(PathGroupGrabber::MoveY);
return true;
}
else if (event->key() == Qt::Key_Z)
{
if (event->modifiers() & Qt::ControlModifier ||
event->modifiers() & Qt::MetaModifier)
m_paths[i]->undo();
else
m_paths[i]->setMoveAxis(PathGroupGrabber::MoveZ);
return true;
}
else if (event->key() == Qt::Key_W)
{
m_paths[i]->setMoveAxis(PathGroupGrabber::MoveAll);
return true;
}
else if (event->key() == Qt::Key_S)
{
int idx = m_paths[i]->pointPressed();
if (idx > -1)
{
float radx = m_paths[i]->getRadX(idx);
if (event->modifiers() & Qt::ShiftModifier)
radx--;
else
radx++;
radx = qMax(1.0f, radx);
m_paths[i]->setRadX(idx, radx, m_sameForAll);
return true;
}
}
else if (event->key() == Qt::Key_T)
{
int idx = m_paths[i]->pointPressed();
if (idx > -1)
{
float rady = m_paths[i]->getRadY(idx);
if (event->modifiers() & Qt::ShiftModifier)
rady--;
else
rady++;
rady = qMax(1.0f, rady);
m_paths[i]->setRadY(idx, rady, m_sameForAll);
}
else // switch to tube mode
{
if (event->modifiers() & Qt::ShiftModifier)
{
m_paths[i]->loadCaption();
}
else
{
bool b = m_paths[i]->tube();
m_paths[i]->setTube(!b);
}
}
return true;
//.........这里部分代码省略.........
示例2: helpFile
bool
MeshGenerator::getValues(int &depth,
int &fillValue,
bool &checkForMore,
bool &lookInside,
QGradientStops &stops,
bool doBorder,
int &chan,
bool &avgColor)
{
chan = 0;
depth = 1;
fillValue = -1;
checkForMore = true;
lookInside = false;
avgColor = false;
m_useTagColors = false;
m_scaleModel = 1.0;
QGradientStops vstops;
vstops << QGradientStop(0.0, QColor(50 ,50 ,50 ,255))
<< QGradientStop(0.5, QColor(200,150,100,255))
<< QGradientStop(1.0, QColor(255,255,255,255));
if (doBorder) fillValue = 0;
PropertyEditor propertyEditor;
QMap<QString, QVariantList> plist;
QVariantList vlist;
vlist.clear();
vlist << QVariant("checkbox");
vlist << QVariant(avgColor);
plist["average color"] = vlist;
vlist.clear();
vlist << QVariant("checkbox");
vlist << QVariant(m_useTagColors);
plist["apply tag colors"] = vlist;
vlist.clear();
vlist << QVariant("int");
vlist << QVariant(chan);
vlist << QVariant(0);
vlist << QVariant(2);
plist["mop channel"] = vlist;
vlist.clear();
vlist << QVariant("int");
vlist << QVariant(depth);
vlist << QVariant(0);
vlist << QVariant(200);
plist["depth"] = vlist;
vlist.clear();
vlist << QVariant("int");
vlist << QVariant(fillValue);
vlist << QVariant(-1);
vlist << QVariant(255);
plist["fillvalue"] = vlist;
vlist.clear();
vlist << QVariant("checkbox");
vlist << QVariant(checkForMore);
plist["greater"] = vlist;
vlist.clear();
vlist << QVariant("checkbox");
vlist << QVariant(lookInside);
plist["look inside"] = vlist;
vlist.clear();
vlist << QVariant("float");
vlist << QVariant(m_scaleModel);
vlist << QVariant(0.001);
vlist << QVariant(1.0);
vlist << QVariant(0.005); // singlestep
vlist << QVariant(3); // decimals
plist["scale"] = vlist;
vlist.clear();
vlist << QVariant("colorgradient");
for(int s=0; s<vstops.size(); s++)
{
float pos = vstops[s].first;
QColor color = vstops[s].second;
int r = color.red();
int g = color.green();
int b = color.blue();
int a = color.alpha();
vlist << QVariant(pos);
vlist << QVariant(r);
vlist << QVariant(g);
vlist << QVariant(b);
vlist << QVariant(a);
}
plist["color gradient"] = vlist;
vlist.clear();
//.........这里部分代码省略.........
示例3: helpFile
//.........这里部分代码省略.........
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;
if (m_scale1 < 0 || m_scale2 < 0)
mesg += QString("scales : %1 %2\n").arg(-m_scale1).arg(-m_scale2);
else
mesg += QString("vscales : %1 %2\n").arg(m_scale1).arg(m_scale2);
mesg += QString("opacity : %1\n").arg(m_opacity);
mesg += QString("position : %1 %2 %3\n"). \
arg(m_position.x).arg(m_position.y).arg(m_position.z);
Quaternion q = orientation();
Vec axis;
qreal angle;
q.getAxisAngle(axis, angle);
mesg += QString("rotation : %1 %2 %3 : %4\n"). \
arg(axis.x).arg(axis.y).arg(axis.z).arg(RAD2DEG(angle));
mesg += QString("Red axis : %1 %2 %3\n"). \
arg(m_xaxis.x).arg(m_xaxis.y).arg(m_xaxis.z);
mesg += QString("Green axis : %1 %2 %3\n"). \
arg(m_yaxis.x).arg(m_yaxis.y).arg(m_yaxis.z);
mesg += QString("Blue axis : %1 %2 %3\n"). \
arg(m_tang.x).arg(m_tang.y).arg(m_tang.z);
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";
示例4: 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;
}