Cleaned up connections

This commit is contained in:
Borna Rajković committed 2022-05-07 14:19:43 +02:00
1 parent 344fe7cfa6
commit 5ccd9b2fa4
11 files changed
+53 -53

No files matched your search

+4 -4
View File
@@ -97,11 +97,11 @@ void ComponentItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
});
menu.addSeparator();
for(auto attr: componentInstance->attributes) {
bool enabled = attr->attribute.getPopup().has_value();
bool enabled = attr.attribute.getPopup().has_value();
auto action = menu.addAction(QString::fromStdString("Izmjeni " + attr->name),
[attr, this]() {
DialogManager::updateAttribute(attr);
auto action = menu.addAction(QString::fromStdString("Izmjeni " + attr.name),
[&attr, this]() {
DialogManager::updateAttribute(&attr);
this->redraw();
});
+4 -4
View File
@@ -15,13 +15,13 @@ void Schema::setSchema(domain::Schema* schema)
this->schema = schema;
if(schema != nullptr) {
for(auto &instance: schema->componentInstances) {
ComponentWrapper *component = ComponentWrapper::ofComponent(&instance);
component->setPos(instance.position.first, instance.position.second);
ComponentWrapper *component = ComponentWrapper::ofComponent(instance.get());
component->setPos(instance->position.first, instance->position.second);
scene.addItem(component);
}
for(auto &instance: schema->busInstances) {
ComponentWrapper *bus = ComponentWrapper::ofBus(&instance);
bus->setPos(instance.position.first, instance.position.second);
ComponentWrapper *bus = ComponentWrapper::ofBus(instance.get());
bus->setPos(instance->position.first, instance->position.second);
scene.addItem(bus);
}
}