Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edge addition/deletion/attributes #48

Open
wants to merge 7 commits into
base: socis19
Choose a base branch
from

Conversation

Sedictious
Copy link
Contributor

No description provided.

@@ -50,21 +50,28 @@ public slots:
void slotDeselectedNode(const Node& node);
void slotDeselectedEdge(const Edge& edge);
void slotDelete();
void slotChangeAttrScope(AttributesScope nodeAttrScope);
void slotChangeNodeAttrsScope(AttributesScope attrScope);
void slotChangeEdgeAttrsScope(AttributesScope attrScope);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be better to take a const reference instead of a copy of the attrScope, i.e.,

    void slotChangeNodeAttrsScope(const AttributesScope& attrScope);
    void slotChangeEdgeAttrsScope(const AttributesScope& attrScope);

void hideLayout(QFormLayout* layout);
void showLayout(QFormLayout* layout);

private slots:
void slotChangeAttrScope(AttributesScope nodeAttrScope, std::vector<std::shared_ptr<AttrWidget>>& attrWidget, QFormLayout* lattrs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't need to be a slot
it could be just a private function... might be better to also rename it to something like updateAttrScope
the parameter AttributesScope nodeAttrScope should be const AttributesScope& attrScope

m_abstractGraph->removeEdge(edge.second);
}

clearSelection();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll probably get a crash here
have you tested removing an edge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I'm still looking into it. It only crashes when deleting an edge you've added through the graph editor 🤔

Edit: Actually it seems to be because of the edge attributes pointer, I'll see if I can fix it.

@Sedictious
Copy link
Contributor Author

@cardinot I got back to the problem and it seems like the crash happens only when attempting to delete user-created edges. I think it's because I made a mistake when passing the attributes to create_Edge but I'm having trouble pinpointing the exact cause. Could you take a look whenever you find the time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants