QML and QWidgers performance
-
Initially I've started building GUI for my desktop application using QT Quick QML. However later I had to switch to QWidgets because of performance issues.
My goal was to replicate console terminal inside GUI. This console had to be able to process very large amount of data output per second.
QML TextArea couldn't handle this task very well and froze GUI if there was too much data for it to handle. On the other hand, QPlaintextedit turned out to be much faster and being able to solve this problem without slowing down GUI at all.
When I'm using widgets, all I have to do is to find a corresponding class to a particular widget, then find a pointer to my widget. From that point I have full access to my GUI elements from C++. In QML this task was a bit more compilcated. There is no C++ class like "QTextArea", so I have to use a base class like QObject for my pointer to TextArea. I wasn't able to find how to invoke some commands to TextArea like append() from C++, so first I had to call an additional function in QML from C++ that appends a new string.
One last thing to mention is that TextArea doesn't seem to have property that would limit how much text it can hold, unlike QPlaintextedit.
Have I done something wrong or indeed QPlaintextedit widget is better than QML TextArea in this particular case? What about performance of QWidgets vs QML in general?
-
I too had the similar experience with QML. When the lot of data is getting generated in C++ and need to be passed to QML, I had lot of issues. Finally I switched to Qt for doing this work. My feel is if you have huge to generated in C++ etc, better to work with Qt directly rather than QML.