ModelNode* node1 = new ModelNode(); ModelNode* node2 = new ModelNode(); node2->setParent(node1); ModelNode* parent = node2->parentProperty();
if(node->parentProperty()->property("visible").toBool()) { // do something }In this example, we use the parentProperty method to retrieve the parent of a given node. We then check if the "visible" property of the parent node is true using the toBool method. If it is, we execute some code. Package library: Qt 5.