}
void BoxItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+
+ if (!visible) return;
+
QPen pen(Qt::black, 3);
if(selected)
pen.setColor(Qt::red);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
int dimY = dimensionStr.at(1).toInt(&ok);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString visStr = funcElement.attribute("visible","none");
+ bool showItem = true;
+ if (visStr == "false") {
+ showItem = false;
+ }
ReferenceBlock *referenceMd5 = NULL;
ReferenceBlock *referenceXml = NULL;
}
GroupBlock* parentGroupBlock = AB_TO_GRP(((GroupItem *)parentItem())->getRefBlock());
- FunctionalBlock* functionalBlock = params->getGraph()->createFunctionalBlock(parentGroupBlock, reference);
+ FunctionalBlock* functionalBlock = params->getGraph()->createFunctionalBlock(parentGroupBlock, reference, false);
/* NB: addFunctionalBlock creates all interfaces from the reference, which is annoying when
reading bif_iface tags. Thus interface are all removed.
*/
}
// recreate all (non-control) interfaces because of some may have a multiplicity>1 with several examplars
- functionalBlock->removeAllInterfaces();
+ //functionalBlock->removeAllInterfaces();
QDomNodeList interfaceNodes = funcElement.elementsByTagName("bif_iface");
// setting interfaces (user name, and for multiplicity>1 may be create some new ones)
for(int i=0; i<interfaceNodes.length(); i++) {
interfaceItem->setOrientation(orientation);
interfaceItem->setPositionRatio(position);
}
+ setVisible(showItem);
updateGeometry(Resize);
}
writer.writeAttribute("position",attrPos);
QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
writer.writeAttribute("dimension",attrDim);
+ if (!isVisible()) {
+ writer.writeAttribute("visible","false");
+ }
writer.writeStartElement("bif_parameters");
foreach(BlockParameter *param,refBlock->getParameters()){
writer.writeAttribute("id",QString::number(inter->getId()));
writer.writeAttribute("name",inter->getName());
- writer.writeAttribute("ref_name",inter->refInter->getName());
+ writer.writeAttribute("ref_name",inter->getReferenceName());
writer.writeAttribute("orientation",inter->getStrOrientation());
writer.writeAttribute("position",QString::number(inter->getPositionRatio()));