本文整理汇总了C++中FWObject::getRO方法的典型用法代码示例。如果您正苦于以下问题:C++ FWObject::getRO方法的具体用法?C++ FWObject::getRO怎么用?C++ FWObject::getRO使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWObject
的用法示例。
在下文中一共展示了FWObject::getRO方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeUserFolder
void ObjectManipulator::removeUserFolder()
{
ObjectTreeViewItem *item = dynamic_cast<ObjectTreeViewItem *>
(getCurrentObjectTree()->currentItem());
if (item == 0 || item->getUserFolderParent() == 0) return;
ObjectTreeViewItem *parent = dynamic_cast<ObjectTreeViewItem *>
(item->parent());
assert(parent != 0);
vector<FWObject *> objs;
for (int ii = 0; ii < item->childCount(); ii++) {
ObjectTreeViewItem *child = dynamic_cast<ObjectTreeViewItem *>
(item->child(ii));
FWObject *obj = child->getFWObject();
if (obj->getRO()) {
QMessageBox::critical(this, "Firewall Builder",
tr("Folder with locked object "
"cannot be deleted"));
return;
}
objs.push_back(obj);
}
if (objs.size() > 0) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
ConfirmDeleteObjectDialog confirm(this);
confirm.load(objs);
QApplication::restoreOverrideCursor();
if (confirm.exec() == QDialog::Rejected) return;
}
FWCmdMacro *macro = new FWCmdMacro(tr("Delete user folder"));
QList<QTreeWidgetItem *> children = item->takeChildren();
while (!children.isEmpty()) {
ObjectTreeViewItem *child = dynamic_cast<ObjectTreeViewItem *>
(children.takeFirst());
assert(child != 0);
FWObject *obj = child->getFWObject();
if (mw->isEditorVisible() && mw->getOpenedEditor() == obj) {
mw->hideEditor();
}
deleteObject(obj, macro);
}
FWCmdRemoveUserFolder *cmd =
new FWCmdRemoveUserFolder(m_project, parent->getFWObject(),
item->getUserFolderName(), "", macro);
FWObject *newObj = cmd->getNewState();
set<string> folders = stringToSet(newObj->getStr("subfolders"));
folders.erase(item->getUserFolderName().toUtf8().constData());
newObj->setStr("subfolders", setToString(folders));
m_project->undoStack->push(macro);
}