Creating Editable Flowchart in Qt / C ++

I am working on creating an editable flowchart, and I have a lot of problems conceptually with Qt. I tried many different ways to implement classes, starting from QTreeWidget , QTableWidget and using just empty QPushButtons .

Ideally, I would like to have a setting where I can right-click on each part of the stream and edit it. In addition to the drag and drop function of objects in the stream. Trying to find a class / group of classes that I can use together to achieve this is a struggle.

Which classes will work best for this application; in particular, GUI classes? The actual editing content should not be related to the graphical interface. I am looking for suggestions or methods that I might have missed. Besides functionality, it should not look like such a fantasy; rectangles and straight lines.

Until now, I know how to use and implement contextMenus and regular menus to contain all the actions I need, but now I need to find a model and view that are compatible with my plans and store the data. (This is the easy part, I have my own class for this)

I am new to Qt and C ++. (Not new to object-oriented programming, just different syntax and API.)

The kind of flowchart I'm looking for is this:

Gmztf.png

Or you can just google β€œflowchart” (taken from the context and I don't need colors)

Thanks in advance. I have not yet found a solution that I understood; or which uses hard Qt coding. Any suggestions are welcome.

+5
source share
2 answers

There is an Example Scene Diagram that uses a graphical representation structure to create flowchart diagrams. This is an application where you can add shapes and block diagram text and connect shapes with arrows. Shapes, arrows, and text can be set in different colors, and you can change the font, style, and underline of the text.

You can take a look at the code and see how to create custom graphic elements and handle mouse events and moving elements.

+4
source

You can use the QCustomPlot library. It supports rectangle and other shaped elements and lines, etc. It will simply simplify your work.

http://www.qcustomplot.com/

+1
source

Source: https://habr.com/ru/post/1200149/


All Articles