本文整理汇总了C++中app::PropertyContainer::getPropertyDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyContainer::getPropertyDocumentation方法的具体用法?C++ PropertyContainer::getPropertyDocumentation怎么用?C++ PropertyContainer::getPropertyDocumentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::PropertyContainer
的用法示例。
在下文中一共展示了PropertyContainer::getPropertyDocumentation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractTipsFromProperties
void CallTipsList::extractTipsFromProperties(Py::Object& obj, QMap<QString, CallTip>& tips) const
{
App::PropertyContainerPy* cont = (App::PropertyContainerPy*)(obj.ptr());
App::PropertyContainer* container = cont->getPropertyContainerPtr();
// Make sure that the C++ object is alive
if (!container) return;
std::map<std::string,App::Property*> Map;
container->getPropertyMap(Map);
for (std::map<std::string,App::Property*>::const_iterator It=Map.begin();It!=Map.end();++It) {
CallTip tip;
QString str = QString::fromLatin1(It->first.c_str());
tip.name = str;
tip.type = CallTip::Property;
QString longdoc = QString::fromUtf8(container->getPropertyDocumentation(It->second));
// a point, mesh or shape property
if (It->second->isDerivedFrom(Base::Type::fromName("App::PropertyComplexGeoData"))) {
Py::Object data(It->second->getPyObject(), true);
if (data.hasAttr("__doc__")) {
Py::Object help = data.getAttr("__doc__");
if (help.isString()) {
Py::String doc(help);
longdoc = QString::fromUtf8(doc.as_string().c_str());
}
}
}
if (!longdoc.isEmpty()) {
int pos = longdoc.indexOf(QLatin1Char('\n'));
pos = qMin(pos, 70);
if (pos < 0)
pos = qMin(longdoc.length(), 70);
tip.description = stripWhiteSpace(longdoc);
tip.parameter = longdoc.left(pos);
}
tips[str] = tip;
}
}