本文整理汇总了C++中qrrepo::RepoApi::stringProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ RepoApi::stringProperty方法的具体用法?C++ RepoApi::stringProperty怎么用?C++ RepoApi::stringProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qrrepo::RepoApi
的用法示例。
在下文中一共展示了RepoApi::stringProperty方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindingGenerator
PioneerGetLPSPosition::PioneerGetLPSPosition(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "quadcopterCommands/getLPSPosition.t"
, {
Binding::createConverting(
"@@[email protected]@"
, "X"
, customizer.factory()->stringPropertyConverter(id, "X"))
, Binding::createConverting(
"@@[email protected]@"
, "Y"
, customizer.factory()->stringPropertyConverter(id, "Y"))
, Binding::createConverting(
"@@[email protected]@"
, "Z"
, customizer.factory()->stringPropertyConverter(id, "Z"))
}
, parent)
{
customizer.factory()->functionBlockConverter(id, "")->convert(
QString("%1 = 0;%2 = 0;%3 = 0;")
.arg(repo.stringProperty(id, "X"))
.arg(repo.stringProperty(id, "Y"))
.arg(repo.stringProperty(id, "Z")));
}
示例2: intProperty
int QrsMetamodelLoader::intProperty(const qrRepo::RepoApi &repo, const Id &id
, const QString &propertyName, int defaultValue)
{
if (!repo.hasProperty(id, propertyName)) {
return defaultValue;
}
return parseInt(repo.stringProperty(id, propertyName), id);
}
示例3: boolProperty
bool QrsMetamodelLoader::boolProperty(const qrRepo::RepoApi &repo, const Id &id
, const QString &propertyName, bool defaultValue)
{
if (!repo.hasProperty(id, propertyName)) {
return defaultValue;
}
return repo.stringProperty(id, propertyName) == "true";
}
示例4: stringProperty
QString QrsMetamodelLoader::stringProperty(const qrRepo::RepoApi &repo, const Id &id
, const QString &propertyName, const QString &defaultValue)
{
if (!repo.hasProperty(id, propertyName)) {
return defaultValue;
}
return repo.stringProperty(id, propertyName);
}
示例5: result
QVector<int> QrsMetamodelLoader::intVectorProperty(const qrRepo::RepoApi &repo, const Id &id
, const QString &propertyName, const QVector<int> &defaultValue)
{
if (!repo.hasProperty(id, propertyName)) {
return defaultValue;
}
const QStringList values = repo.stringProperty(id, propertyName).split(",", QString::SkipEmptyParts);
QVector<int> result(values.size());
for (int i = 0; i < values.size(); ++i) {
result[i] = parseInt(values[i], id);
}
return result;
}
示例6: parseProperties
void QrsMetamodelLoader::parseProperties(const qrRepo::RepoApi &repo, ElementType &element, const Id &id)
{
const IdList children = repo.children(id);
for (const Id &child : children) {
if (child.type() == metamodelAttributeType && repo.isLogicalElement(id)) {
const QString type = repo.stringProperty(child, "attributeType");
element.addProperty(repo.name(child), type
, stringProperty(repo, child, "defaultValue", "string")
, stringProperty(repo, child, "displayedName")
, stringProperty(repo, child, "description")
, type == "reference");
}
}
}
示例7: BindingGenerator
PrintTextBlockGenerator::PrintTextBlockGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/printText.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "XCoordinateText"
, customizer.factory()->intPropertyConverter(id, "XCoordinateText"))
<< Binding::createConverting("@@[email protected]@", "YCoordinateText"
, customizer.factory()->intPropertyConverter(id, "YCoordinateText"))
<< (repo.property(id, "Evaluate").toBool()
? Binding::createConverting("@@[email protected]@", "PrintText"
, customizer.factory()->stringPropertyConverter(id, "PrintText"))
: Binding::createStatic("@@[email protected]@"
, utils::StringUtils::wrap(repo.stringProperty(id, "PrintText"))))
, parent)
{
}
示例8: parseNode
void QrsMetamodelLoader::parseNode(const qrRepo::RepoApi &repo
, Metamodel &metamodel, const Id &diagram, const Id &id)
{
NodeElementType *node = new NodeElementType(metamodel);
node->setName(validateName(repo, id));
node->setFriendlyName(repo.stringProperty(id, "displayedName"));
node->setDiagram(repo.name(diagram));
node->setMouseGesture(stringProperty(repo, id, "path"));
node->setDescription(stringProperty(repo, id, "description"));
node->setHidden(boolProperty(repo, id, "abstract"));
node->setResizable(boolProperty(repo, id, "isResizeable", true));
node->setCreateChildrenFromMenu(boolProperty(repo, id, "createChildrenFromMenu"));
parseSdfGraphics(repo, *node, id);
parseContainerProperties(repo, *node, id);
parseProperties(repo, *node, id);
metamodel.addElement(*node);
}
示例9: BindingGenerator
PrintTextBlockGenerator::PrintTextBlockGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/printText.t", {
Binding::createConverting("@@[email protected]@", "XCoordinateText"
, customizer.factory()->intPropertyConverter(id, "XCoordinateText"))
, Binding::createConverting("@@[email protected]@", "YCoordinateText"
, customizer.factory()->intPropertyConverter(id, "YCoordinateText"))
, (repo.property(id, "Evaluate").toBool()
? Binding::createConverting("@@[email protected]@", "PrintText"
, customizer.factory()->stringPropertyConverter(id, "PrintText"))
: Binding::createStatic("@@[email protected]@"
, utils::StringUtils::wrap(repo.stringProperty(id, "PrintText"))))
}, parent)
{
// Calling virtual readTemplate() before base class constructor will cause segfault.
addBinding(Binding::createStatic("@@[email protected]@", repo.property(id, "Redraw").toBool()
? readTemplate("drawing/redraw.t") : QString()));
}
示例10: parseEdge
void QrsMetamodelLoader::parseEdge(const qrRepo::RepoApi &repo
, Metamodel &metamodel, const Id &diagram, const Id &id)
{
EdgeElementType *edge = new EdgeElementType(metamodel);
edge->setName(validateName(repo, id));
edge->setFriendlyName(repo.stringProperty(id, "displayedName"));
edge->setDiagram(repo.name(diagram));
edge->setDescription(stringProperty(repo, id, "description"));
edge->setDividable(boolProperty(repo, id, "isDividable"));
edge->setPenWidth(1);
edge->setPenColor(Qt::black);
edge->setPenStyle(parsePenStyle(stringProperty(repo, id, "lineType"), id));
edge->setShapeType(parseLinkShape(stringProperty(repo, id, "shape"), id));
const QString labelText = stringProperty(repo, id, "labelText");
if (!labelText.isEmpty()) {
LabelProperties label;
const QString labelType = stringProperty(repo, id, "labelType");
if (labelType.contains("static", Qt::CaseInsensitive)) {
label = LabelProperties(0, 0, 0, labelText, 0);
} else if (labelType.contains("dynamic", Qt::CaseInsensitive)) {
label = LabelProperties(0, 0, 0, labelText, false, 0);
} else {
emit errorOccured(tr("Incorrect label type"), id);
}
label.setHard(boolProperty(repo, id, "hardLabel"));
edge->addLabel(label);
}
parseAssociations(repo, *edge, id);
parseProperties(repo, *edge, id);
parsePorts(repo, *edge, id, "from");
parsePorts(repo, *edge, id, "to");
metamodel.addElement(*edge);
}
示例11: BindingGenerator
DrawRectGenerator::DrawRectGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, (repo.stringProperty(id, "Filled") == "true")
? "drawing/drawFilledRect.t"
: "drawing/drawRect.t"
, {
Binding::createConverting("@@[email protected]@", "XCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "XCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "YCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "YCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "WidthRect"
, customizer.factory()->intPropertyConverter(id, "WidthRect"))
, Binding::createConverting("@@[email protected]@", "HeightRect"
, customizer.factory()->intPropertyConverter(id, "HeightRect"))
}
, parent)
{
addBinding(Binding::createStatic("@@[email protected]@", repo.property(id, "Redraw").toBool()
? readTemplate("drawing/redraw.t") : QString()));
}