本文整理汇总了C++中app::Property::getContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::getContainer方法的具体用法?C++ Property::getContainer怎么用?C++ Property::getContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::Property
的用法示例。
在下文中一共展示了Property::getContainer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendProperty
void PropertyEditor::appendProperty(const App::Property& prop)
{
// check if the parent object is selected
std::string editor = prop.getEditorName();
if (editor.empty())
return;
App::PropertyContainer* parent = prop.getContainer();
std::string context = prop.getName();
bool canAddProperty = (!propList.empty());
for (PropertyModel::PropertyList::iterator it = propList.begin(); it != propList.end(); ++it) {
if (it->second.empty() || it->second.size() > 1) {
canAddProperty = false;
break;
}
else if (it->second.front()->getContainer() != parent) {
canAddProperty = false;
break;
}
}
if (canAddProperty) {
std::vector<App::Property*> list;
list.push_back(const_cast<App::Property*>(&prop));
std::pair< std::string, std::vector<App::Property*> > pair = std::make_pair(context, list);
propList.push_back(pair);
propertyModel->appendProperty(prop);
}
}
示例2: slotChangePropertyEditor
void PropertyView::slotChangePropertyEditor(const App::Property& prop)
{
App::PropertyContainer* parent = prop.getContainer();
if (parent && parent->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
propertyEditorData->updatetEditorMode(prop);
}
else if (parent && parent->isDerivedFrom(Gui::ViewProvider::getClassTypeId())) {
propertyEditorView->updatetEditorMode(prop);
}
}
示例3: slotRemoveDynamicProperty
void PropertyView::slotRemoveDynamicProperty(const App::Property& prop)
{
App::PropertyContainer* parent = prop.getContainer();
if (parent && parent->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
propertyEditorData->removeProperty(prop);
}
else if (parent && parent->isDerivedFrom(Gui::ViewProvider::getClassTypeId())) {
propertyEditorView->removeProperty(prop);
}
}
示例4: slotAppendDynamicProperty
void PropertyView::slotAppendDynamicProperty(const App::Property& prop)
{
App::PropertyContainer* parent = prop.getContainer();
if (parent->isHidden(&prop) || prop.testStatus(App::Property::Hidden))
return;
if (parent && parent->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
propertyEditorData->appendProperty(prop);
}
else if (parent && parent->isDerivedFrom(Gui::ViewProvider::getClassTypeId())) {
propertyEditorView->appendProperty(prop);
}
}