if (getScene() == NULL) return;
- QList<BoxItem *> blocks = getScene()->getBlockItems();
+ QList<BoxItem *> blocks = getScene()->getBoxItems();
if(blocks.length() > 0) {
// first, search for blocks that are at (0,0)
int xMaxZero = 0;
originPoint.setY(y);
if ((boxSizeChanged) || (newSize != oldSize) || (originPoint != oldOrigin)) {
- cout << "must change group item shape" << endl;
+ cout << "GroupItem: must change group item shape" << endl;
prepareGeometryChange();
return true;
}
return false;
}
+void GroupItem::nameChanged() {
+
+
+ QFontMetrics fmId(params->defaultBlockFont);
+ nameWidth = fmId.width(refBlock->getName());
+ nameHeight = fmId.height();
+ // changing the BoxItem in the upperscene
+ if (parentItem != NULL) {
+ parentItem->nameChanged();
+ }
+ updateGeometry(InterfaceMove);
+ // force the update in case of the size has not changed
+ update();
+}
+
+
void GroupItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if(params->editState == Parameters::EditGroupMove) {
if(ifaceItem != NULL)
dispatcher->renameInterface(ifaceItem);
else
- dispatcher->renameBlockOrGroup(this);
+ dispatcher->renameGroupBlock(this);
}
else if(selectedAction == showProperties){
dispatcher->showProperties(ifaceItem);
double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
- GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction);
+ GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction,AbstractInterface::Data);
InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupInterface,this,params);
interfaceItem->setId(id);
if(parentItem != NULL){
attrUpperItem = QString::number(parentItem->getId());
}
- QString attrPos = QString::number(pos().x()).append(",").append(QString::number(pos().y()));
+ QString attrPos = QString::number((int)(pos().x())).append(",").append(QString::number((int)(pos().y())));
QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));