本文整理汇总了C++中app::Property::testStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::testStatus方法的具体用法?C++ Property::testStatus怎么用?C++ Property::testStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::Property
的用法示例。
在下文中一共展示了Property::testStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatetEditorMode
void PropertyEditor::updatetEditorMode(const App::Property& prop)
{
// check if the parent object is selected
std::string editor = prop.getEditorName();
if (editor.empty())
return;
bool hidden = prop.testStatus(App::Property::Hidden);
bool readOnly = prop.testStatus(App::Property::ReadOnly);
int column = 1;
int numRows = propertyModel->rowCount();
for (int i=0; i<numRows; i++) {
QModelIndex item = propertyModel->index(i, column);
PropertyItem* propItem = static_cast<PropertyItem*>(item.internalPointer());
if (propItem && propItem->hasProperty(&prop)) {
setRowHidden (i, QModelIndex(), hidden);
propItem->updateData();
if (item.isValid()) {
updateItemEditor(!readOnly, column, item);
dataChanged(item, item);
}
break;
}
}
}
示例2: getEditorMode
PyObject* PropertyContainerPy::getEditorMode(PyObject *args)
{
char* name;
if (!PyArg_ParseTuple(args, "s", &name)) // convert args: Python->C
return NULL; // NULL triggers exception
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
Py::List ret;
if (prop) {
short Type = prop->getType();
if ((prop->testStatus(Property::ReadOnly)) || (Type & Prop_ReadOnly))
ret.append(Py::String("ReadOnly"));
if ((prop->testStatus(Property::Hidden)) || (Type & Prop_Hidden))
ret.append(Py::String("Hidden"));
}
return Py::new_reference_to(ret);
}
示例3: 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);
}
}