Unsolved Need advice with new project (Should I use PyQT)
-
Apologies for a badly written question title. I know it doesn't give a lot of details, but I'm just beginning with PyQT and haven't developed the vocabulary to convey succinctly.
Here's my query:
I want to develop an interface which lets users draw a ellipses and unidirectional arrows (graph) between them. Based on this graph and its nodes and edges something happens.
I want to know- If PyQT is a good choice for this project? Or if not, what else would you suggest?
- how to let users draw these shapes like they would in a flowchart program?
- how to read the connections and then play with it?
- what concepts, terms, etc do I need to get familiar with to get started?
I'm absolute beginner in pyQT with only having written a hello world but I am sure I can quickly learn if I know which way to go.
Thanks!
-
@jash
Just for the PyQt question. It doesn't terribly matter whether you use C++, PySide or PyQt, they all allow you to write code using Qt libraries. In that sense, all will allow you to develop this graph program. C++ Qt and PySide are LGPL licence, PyQt is GPL, if you are intending to distribute your application that does make a difference. -
@JonB so I would have to make my project open sourced if I use PyQt? That is fine, I plan to open source it anyway.
Could you guide me to any resource which would help me learn what is required to make such an application?
-
Hi and welcome to devnet,
From your description, you might want to check the Graphics View Framework.
In any case, please take the time to do some tutorials building simple stuff to get used to building GUI.
You might also want to check the extensive collection of applications develop with/for KDE. You may have something there that might get you started more quickely.
-
@SGaist said in Need advice with new project (Should I use PyQT):
From your description, you might want to check the Graphics View Framework.
In any case, please take the time to do some tutorials building simple stuff to get used to building GUI.
+1 for Graphics View, and +1 for the examples. The diagram scene example was my running start with Qt for a similar network visualization application.
There are a few pieces of the C++ api that are missing in PyQt and PySide. I haven't encountered any that would dissuade me, but sometimes the C++ class documentation isn't sufficient. https://wiki.qt.io/Qt_for_Python_Missing_Bindings attempts to provide a current list.
In general, object lifetime management is slightly more complicated than a typical python or C++ program.
-
@jeremy_k thanks, the diagram scene does look pretty similar to what I intend to do. Does it give the diagram information which I can use to know how the graph looks?
I'm okay with learning and don't want to run away from it. Is there a python example I can look at? -
@jash said in Need advice with new project (Should I use PyQT):
@jeremy_k thanks, the diagram scene does look pretty similar to what I intend to do. Does it give the diagram information which I can use to know how the graph looks?
I'm not quite clear on the question. If you're referring to generating a data structure suitable for traversing the graph, I believe that I implemented my own by adding code to the existing functions. E.g. DiagramItem.__init__() from the example linked below provides an opportunity to track new objects in the diagram.
I'm okay with learning and don't want to run away from it. Is there a python example I can look at?
For PySide/Qt for Python
https://doc.qt.io/qtforpython-6/examples/example_widgets_graphicsview_diagramscene.htmlI recall seeing PyQt ports of the examples, but don't have a link handy.