-
Notifications
You must be signed in to change notification settings - Fork 748
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
graph editor #38
Comments
Hey This looks awesome :) I just made the items invisible ( And because sometimes I got those warnings: Also as stated here http://doc.qt.io/qt-5/qgraphicsscene.html#removeItem, you are responsible to destroy the QGraphicsItems with Btw, I'm curious what are you planning to use the graph editor for? |
Oh wow! Thanks again therecipe! Yes, I'm on windows. Graph editor will be used as a front end to generate an xml file for a python multiprocessing pipeline someone else wrote here at work. So current plan is to only generate xml. I hope to use it for a lot of other things though. I tried to make the node/graph separate from the figures drawn on the canvas but I'm not sure I've got the abstractions right for Go. I spent so much time thinking about it I ended up reinventing a feature for Go someone else proposed 2 years ago (https://groups.google.com/forum/#!searchin/golang-nuts/why$20do$20interfaces$20not$20describe$20properties%7Csort:date/golang-nuts/ZJ5DEv_36S8/ZgADJo061JkJ). It was never implemented though ;/ I think I might have over-abstracted. Open to any and all suggestions. |
Hey I'm busy for the next few days, but I will look into it asap. |
Hey I looked into it again and concerning the separation of the node from the figures, you probably meant this part? type Figure interface {
GetX() float64
SetX(x float64)
GetY() float64
SetY(y float64)
GetNode() *graph.Node
AddEdgeIncoming(l Link)
AddEdgeOutgoing(l Link)
// RemoveEdge()
} Its unfortunately necessary to write own getter/setter functions, so there is nothing wrong with that. Btw, if you update to a6a0643 or later you will get this error:
Because qtmoc is now invoked on all sub-dirs (and there will be a lot of new moc* files). |
https://github.com/5k3105/AM
I uploaded the graph editor I've been working on. It's very incomplete but I need to stop here because the screen updates just don't work.
Left click on screen to plot rectangle
If you have two rectangles you can click on one and click on the other and it will draw a connecting line.
Right click to delete rectangle. This should also delete the lines connected to it.
Left clicking the top right of rectangle switches into Move mode. Clicking again will drop the rectangle where you moved it to.
All this appears to work.
However if you play around you can see:
Sometimes the line to draw the connections will stay on the screen even though there's already been a RemoveItem call.
If you move the rectangle and drop it then right click to remove, the node will disappear from the list on the left panel but the image will persist on the screen. So will it's edges. And if it's connected to another rectangle and you move that rectangle, the edge will follow as if it hasn't been deleted but it has.
I will try to strip this project down to the bare minimum so as to be a good example program for others but at the moment the scene updates don't work right.
The text was updated successfully, but these errors were encountered: