-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: socis19
Are you sure you want to change the base?
Conversation
src/gui/fullinspector.h
Outdated
@@ -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); |
There was a problem hiding this comment.
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);
src/gui/fullinspector.h
Outdated
void hideLayout(QFormLayout* layout); | ||
void showLayout(QFormLayout* layout); | ||
|
||
private slots: | ||
void slotChangeAttrScope(AttributesScope nodeAttrScope, std::vector<std::shared_ptr<AttrWidget>>& attrWidget, QFormLayout* lattrs); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@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 |
No description provided.