The MindFusion Forums
Flow Diagramming Components >> Feature Suggestions >> Flow diagramming for QT?
https://mindfusion.eu/Forum/YaBB.pl?num=1561124829

Message started by Kyle Chen on Jun 21st, 2019 at 1:47pm

Title: Flow diagramming for QT?
Post by Kyle Chen on Jun 21st, 2019 at 1:47pm
Hi,

Is that possible you guys make a lib for QT? Or you already have a plan, that will be great!

Thanks,

Kyle Chen

Title: Re: Flow diagramming for QT?
Post by Slavcho on Jun 24th, 2019 at 7:52am
Hi,

We've looked a few times at it and don't have current plans, but we could probably jump on the WebAssembly bandwagon :) Are you using QT Quick or QT Widgets? You might also try running our JavaScript library from inside a QWebView.

Regards,
Slavcho
MindFusion

Title: Re: Flow diagramming for QT?
Post by Kyle Chen on Jun 26th, 2019 at 6:30pm
Hi Slavcho,

For QT, I'm not sure what I will use now. The target platform could be embedded system (Ubuntu something), mobile phone application and/or desktop. Probably performance will be first to consider, so QWebView+JavaScript could not be the first choice for embedded system.

Please keep me updated if you will start a plan for QT.

Thanks,

Kyle Chen

Title: Re: Flow diagramming for QT?
Post by Slavcho on Jun 27th, 2019 at 8:56am
You'll be probably using QT Quick / QML then. What diagram features from our other supported platforms would you need, in case we decide to start planning? :)

Title: Re: Flow diagramming for QT?
Post by Kyle Chen on Jun 27th, 2019 at 4:15pm

Slavcho wrote on Jun 27th, 2019 at 8:56am:
You'll be probably using QT Quick / QML then. What diagram features from our other supported platforms would you need, in case we decide to start planning? :)


You're right, QT Quick/QML would be better.

If possible we expect it similar as desktop as much as possible. Basically we use diagram as a WYSWYG editor(Attached is a sample screen). All the text, barcode, graphic here are diagram nodes. We'll create bitmap for all of them. Some special requirement I can think about for now (based on WinForm version):
1. The most important, the application will run with touch screen which need an easy touch screen operation like easy to move node (maybe hold a node for a while then it turns into moving mode?)
2. Lane needs to be support because the nodes will be split into different lane.
3. Better group/ungroup - once nodes are grouped, the relative position should be always kept same like in Word canvas.

Thanks and looking forward to your early planning!

Kyle Chen

Screen_Sample.png ( 70 KB | 266 Downloads )

Title: Re: Flow diagramming for QT?
Post by Slavcho on Sep 30th, 2019 at 6:15pm
We got some proof of concept code running -
https://mindfusion.eu/_beta/QuickTest.zip


Code (]
import QtQuick 2.12
import QtQuick.Window 2.12

import MindFusion.Diagramming 0.1


Window {
     visible: true
     width: 640
     height: 480
     title: qsTr("Hello World")

     DiagramView {
           objectName: "diagramView"
     }
}

auto diagramView = object->
     findChild<DiagramView*>("diagramView");
if (diagramView)
{
     auto diagram = diagramView->diagram();

     auto node1 = QSharedPointer<DiagramNode>::create();
     node1->setText("Hello,");
     node1->setBounds(QRectF(40, 20, 200, 200));
     diagram->items().add(node1);

     auto node2 = QSharedPointer<DiagramNode>::create();
     node2->setText("World!");
     node2->setImageLocation(
           QUrl("qrc:/tajmahal200.png"));
     node2->setBounds(QRectF(300, 140, 180, 140));
     diagram->items().add(node2);

     QObject::connect(
           diagram.get(), &Diagram::nodeCreated,
           [=):

(auto node)
           {
                 node->setText("I'm new here");
           });
}




- We'd prefer to use shared pointers for the various references kept between items. Unfortunately shared pointers cannot be used from QML, so you'll need to do the diagram controller code in C++ at this time as shown in example above. We'll probably have to add some parallel APIs to access raw QObject* pointers if you want to manipulate the diagram entirely in QML.

- DiagramNode is mostly a data object and rendering is done via a QML component bound to its properties. So we'll probably expose some templating system based on that down the line.

- We have no idea how to handle all the kits and platforms supported by Qt; the archive above contains Qt 5.13.1 / Windows / VC2017 64bit build. We guess we'll have to ship binaries on demand for the various combinations. From what we've heard, the Qt company is developing a marketplace to go along with their Qt 6 release, so that might be something they handle if we upload the source code with them.

Our developer will play with multi-touch APIs next.

Regards,
Slavcho

Title: Re: Flow diagramming for QT?
Post by Kyle Chen on Aug 3rd, 2020 at 10:01pm
Hi Slavcho,

Thank you for looking into this.

Is that possible for you to make a lib targetting the system on the following cpu board (TQMa6x with revision 0114 - QT 5.6.3 supported) so I can do some test?
https://support.tq-group.com/en/arm/tqma6x/linux/ptxdist/overview

My coding environment will be a Ubuntu VMvare machine (v18.0.4 with QT 5.6.3 support) running on Windows 10.

Controller code in C++ is OK to me. For Node rendering, basically I will need to pass a bitmap to the node. And might need to draw different layer over the bitmap (add a "lock" icon on the corner for an example). Example code will help.

Thank you very much,

Kyle

Title: Re: Flow diagramming for QT?
Post by Slavcho on Aug 5th, 2020 at 12:22pm
Hi,

Do you mean you are using some special QT kit to compile for that board, or the standard GCC / desktop will do?

Regards,
Slavcho

Title: Re: Flow diagramming for QT?
Post by Kyle Chen on Aug 10th, 2020 at 1:31pm
Hi Slavcho,

Please hold until I find out what I really want.  :D
Thanks,

Kyle

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.