Coder Social home page Coder Social logo

graph editor about qt HOT 4 CLOSED

therecipe avatar therecipe commented on June 22, 2024
graph editor

from qt.

Comments (4)

therecipe avatar therecipe commented on June 22, 2024

Hey

This looks awesome :)
I send you a small pull request 5k3105/AM#1

I just made the items invisible (QGraphicsItem.SetVisible(false)), before removing them.

And because sometimes I got those warnings: QGraphicsScene::removeItem: item 0x55217150's scene (0x0) is different from this scene (0xa5aa230), I added a simple check to make sure the QGraphicsItem.Scene() is not nil.
IIRC you are developing on windows and therefore won't see these warnings, because you got no visible command-line/shell/terminal?

Also as stated here http://doc.qt.io/qt-5/qgraphicsscene.html#removeItem, you are responsible to destroy the QGraphicsItems with DestroyQGraphicsItem() if you don't need them any longer. (But unfortunately it always crashed after I added those calls, so I kept them out of the pull request)

Btw, I'm curious what are you planning to use the graph editor for?

from qt.

5k3105 avatar 5k3105 commented on June 22, 2024

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.

from qt.

therecipe avatar therecipe commented on June 22, 2024

Hey

I'm busy for the next few days, but I will look into it asap.
And based on what I saw it looks good.

from qt.

therecipe avatar therecipe commented on June 22, 2024

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.
And overall it looks good.

Btw, if you update to a6a0643 or later you will get this error:

controlbox/moc.go:56: NewControlbox redeclared in this block
    previous declaration at controlbox/controlbox.go:20

Because qtmoc is now invoked on all sub-dirs (and there will be a lot of new moc* files).

from qt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.