An addition

Try to draw some line diagrams in qml please.
HTML5 Canvas no problem.
QML ? Please write your own c++ class that you register at qml.

Fail

Am 10.10.2011 08:15, schrieb Ganshorn Thomas:

- Some of the UI in my case are created dynamically either at compile time or at runtime. The former depending on the target platform and the latter depending on the device screen resolution. I don't see this possibility with QML.

Why is that? The fact that the UI is declarative in nature does not mean that it is static or that you have to declare everything beforehand. That is a misconception. It is far easier to change the UI dynamically than it ever was with QWidget and .ui files. Qt Quick is actually designed precicely to target multiple resolutions. Did you have a specific use case in mind?

Regards,

Jens Bache-Wiig


I don't know about his usecases but because this discussion is really interesting for me i can send my usecases.

I have an application.
This application needs to control multiple objects (character rig in vfx, or rig for fluid simulation of flowline)

I need now an ui that can, in certain circumstances reconfigure itself based on the existing and configured objects. That means as one example for each object we have some common states (enabled, disabled, animated or not, active, inactive, stopped, running, keyframe, .... ) and we want to have a dynamic ui that shows these objects in a grouped grid (see windows explorer) where the grouping can be changed at runtime and even created at runtime.

Currently this is a nobrainer in qt widgets.
i have eg an "SysButton" class that shows the name of the system, the state, some functionality. If i have 100 systems i just create 100 buttons, give them in their "initialize" function the name of the system, the button uses that name to find the system from a global class and connecting itself with it. For the 100 buttons i created my own layout class that can show them based on the screensize. The buttons are simply organized in groups, if the screensize is to small for the number of system buttons it will use automatic scale so that the non important buttons get smaller, it can scroll and reorder the buttons if necessary
to show the "Important" ones (they red or orange ones) at top.

This is just a "simple" example.
We have much more complex Userinterfaces that need to be automatically created by the software based on the current scene or workflow step.

Now i thought cool with qml this might be easier and we can have a cooler looking ui for all the artists. They can probably even modify that stuff for their own needs. Part of it is, i don't have to write my SysButton class in c++ and can easily change the visual style great.

BUT ... how can i create 100 of them without extreme large development overhead ?
I can't. In C++ it is only
    SysButton* newButton = new SysButton ( myUIContainer, sysName );
FINISHED !
I did not find a good way to do it in qml, show me one please.
I tried to work with models but really ? Writing a modell for creating a list of sysbuttons ? Sorry this is just not real. It can't be because this would be just stupid.

What is with layout ? i have no idea of how to create a real working dynamic layout in qml. It is just not working in real world situations. Yes it may be possible by using hacks and thousand of lines of javascript code, but this is just not practical. We thought in the end even about creating hundred of qml views in the end that are controlled by c++.


How can i connect the QML SysButtons ? Only if i make all my systems accessible to qml (wich are in the end several thousand objects that i have to make accessible.
And doing this IS a large overhead runtime and development wise)
(Also here show me a good way instead of having a c++ initialize function that belongs to my widget, having a javascript function that belongs to my qml object) Yes i know exactly HERE qml COULD be better because of its runtime capabilities. But the truth is ... it is just not usable

Because debugging IS a REAL nightmare.
Whatever you say i can say from my metrics that using qml took as more than 12 times longer for the current tests than with qwidgets. And yes there is stuff like learning time. But the debugging is just real shit and i know why i say shit. It can be only worse if you have to use remote debugging on a ui application that only writes some traces every now and then and you do not have an debugger.

The ui quality gets much worse than before, not because of missing features but because of the really bad separation of logic and ui. Whatever you say including javascript in files that are to be handled by designers was NOT a good idea and WILL NEVER be a good idea. We dont have ANY designer who can code. Yes they CAN hack some javascript yay. But that is exactly the SHIT that costs time. Because they can't code, they can only hack some stuff into it, That is untested, in many cases not working and just (if you need to integrate more complex functionality) way to much for them. So we realized we have to divide javascript functions and qml separately creating an additional layer on our own that the designers could use. That leaded to much more effort for code maintenance, more complex project structure and more error possibilities.




So we tried another approach ... we use javascript and html5 and what to say ?
It has in reality less problems because it wants to do less.
it works better in our case because there is a separation between layout, look and code. And we have more functionality (we can now easily have a remote ui and even use an ipad to control the system). Needless to say we needed less time to develop this approach including an integrated http server for the communication with our server process than it took as to use qml.



So in reality
i LOVE the idea of an explicit ui layer.
But not like qml does it.
Although html5 has its own problems it IS much better than qml is.
Not performance wise, that is true. But in all other parts.

It is a better structure of
- a html file containing your basic data and elements that can easily created by a c++ part (the 100 button problem).
- css for the style
- at least some layout mechanisms for different screensizes (even if you have to use sometimes device dependent css files, but because these css rules work togehter you do not have to do everyting again and again for each resolution) - a clear separation from code and ui, the code is in its own js file. You only have to initialize your ui once in one initial function that does something like
function initUi()
{
    uiLib.createSlider ( divId );
    uiLib.createTextLine ( divId );
    uiLib.bindFunction ( divId, function );
}



Can qml come to this ? Yes if the nokia trolls really think about that is the problem of html5, how to make it better, where are the strengths of it.
Currently they don't do it.

Thats why qml is a fail and WILL fail
Because why should you use it ?
if the ui is small enough to be managable, you can easily do it in html5 and javascript and be real platform independent.
iOs, android, win8 metro, macosX even the nokia smartphones can use it.

For now qml has only ONE pro.
It is theoretically faster (but not if you do not know how to overcome the billion of speed problems you can easily create)
But it has many cons like
-> untested not finished
-> missing features
-> platform independency
-> way more overhead to accomplish things.



Greetings Thomas














_______________________________________________
Qt5-feedback mailing list
Qt5-feedback@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback



_______________________________________________
Qt5-feedback mailing list
Qt5-feedback@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

_______________________________________________
Qt5-feedback mailing list
Qt5-feedback@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to