本文整理汇总了C++中ObjectGroup::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectGroup::setVisible方法的具体用法?C++ ObjectGroup::setVisible怎么用?C++ ObjectGroup::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectGroup
的用法示例。
在下文中一共展示了ObjectGroup::setVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toTile
ObjectGroup *VariantToMapConverter::toObjectGroup(const QVariantMap &variantMap)
{
ObjectGroup *objectGroup = new ObjectGroup(variantMap["name"].toString(),
variantMap["x"].toInt(),
variantMap["y"].toInt(),
variantMap["width"].toInt(),
variantMap["height"].toInt());
const qreal opacity = variantMap["opacity"].toReal();
const bool visible = variantMap["visible"].toBool();
objectGroup->setOpacity(opacity);
objectGroup->setVisible(visible);
objectGroup->setColor(variantMap.value("color").value<QColor>());
const PixelToTileCoordinates toTile(mMap);
foreach (const QVariant &objectVariant, variantMap["objects"].toList()) {
const QVariantMap objectVariantMap = objectVariant.toMap();
const QString name = objectVariantMap["name"].toString();
const QString type = objectVariantMap["type"].toString();
const int gid = objectVariantMap["gid"].toInt();
const int x = objectVariantMap["x"].toInt();
const int y = objectVariantMap["y"].toInt();
const int width = objectVariantMap["width"].toInt();
const int height = objectVariantMap["height"].toInt();
const QPointF pos = toTile(x, y);
const QPointF size = toTile(width, height);
MapObject *object = new MapObject(name, type,
pos,
QSizeF(size.x(), size.y()));
if (gid) {
bool ok;
const Cell cell = mGidMapper.gidToCell(gid, ok);
object->setTile(cell.tile);
}
if (objectVariantMap.contains("visible"))
object->setVisible(objectVariantMap["visible"].toBool());
object->setProperties(toProperties(objectVariantMap["properties"]));
objectGroup->addObject(object);
const QVariant polylineVariant = objectVariantMap["polyline"];
const QVariant polygonVariant = objectVariantMap["polygon"];
if (polygonVariant.isValid()) {
object->setShape(MapObject::Polygon);
object->setPolygon(toPolygon(polygonVariant));
}
if (polylineVariant.isValid()) {
object->setShape(MapObject::Polyline);
object->setPolygon(toPolygon(polylineVariant));
}
if (objectVariantMap.contains("ellipse"))
object->setShape(MapObject::Ellipse);
}
return objectGroup;
}