Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
The ICommand in the XAML or C#/.NET world provides a type that is bindable to View.qml components. These types get typically implemented in the ViewModel(.cpp).
The equivalent name for this would be, for example, QAbstractCommand. The ICommand, in XAML, has a bool canExecute property and a void execute() method. The canExecute is typically bound to either the enabled or the disabled of a View's component (a menu item, a button, or another thing that can have an action). The execute() method is typically bound to the action (onClicked, onTapped, onSelected, etc).
As a freelance developer I visit many sites (customers) that use Qt. I miss standardization on this. I end up convincing my customers that they must do (something like) this. I would prefer this to be defined at the Qt's framework's level. Very much like how in the XAML and WPF world this is defined by Microsoft's Prism4 and Prism5 techniques. I do think these techniques represent a good and well understood set of idioms or, if you will, patterns on how to develop applications. We can all say that Silverlight did not succeed, but we can't say that the architectural concepts of WPF are bad. In fact, they are all brilliant.
I made an example of how a ICommand, CompositeCommand and DelegateCommand would or could work here: https://github.com/pvanhoof/mvvm
I think we need something similar in Qt or QtQuick.