Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
6.0
-
None
Description
- Basically a ValueEvent can subscribe to multiple properties in multiple items at once. In comparison value signals are handled one value at a time and can result in many redundant calls.
- More precisely a ValueEvent can subscribe to clauses of properties, events and other clauses. The discardIf property could be substituted with a NotClause. The trigger signal can be replaced with a var property that holds a function. Functionality could be added or removed. The syntax can be improved or changed all together.
Possible Syntax for a ValueEvent with subscribedTo and discardIf clauses to avoid race hazards
ValueEvent{ id: naiveMoveEvent subscribedTo: OrClause{ properties:[item.x,item.y] } } ValueEvent{ id: moveEvent subscribedTo: OrClause{ properties:[item.x,item.y] } discardIf: OrClause{ properties: [item.width,item.height] } onTriggered: item.moveTo(item.x,item.y); } ValueEvent{ // or ValueObserver..?? id: redrawEvent subscribedTo: AndClause{ events:[naiveMoveEvent]; clauses: [OrClause{ properties: [item.width,item.height] } ] } onTriggered: item.reBufferAndDraw(item.x,item.y,item.width,item.height); pollingInterval: 500 //ms running: true // Can be turned off and on // delayTriggerInterval: 10 // function check(doTrigger=false){ .. return true | false ; } // Observe if valueEvent occurred since last check even if running===false }
- ValueEvent acts like a filter for unwanted method calls, if any. A ValueEvent can have a relatively high computational and memory cost - it might use accumulators. For performance sensitive workloads what you have to consider is this: Is the cost of filtering out unwanted method calls bigger than the cost of calling the unwanted method calls.
- In particular, in Qt5 signals that communicate visual property changes rapidly clog the UI thread. I hope they will be dropped and not be replaced. Ideally, the scene renderer and the property system should have unmediated communication. E.g. Google have written their own custom renderer that skipped QML entirely to avoid UI blocks: http://google.github.io/VoltAir/doc/main/html/index.html#14 .