qt - Changing default values for properties (e.g. asynchronous) -
for many applications, on low-performance machines, beneficial have built-in components, such loader
, image
, setup load resources asynchronously. this, there 2 obvious options:
- set required property of built-in component, i.e.
asynchronous: true
- create custom component
asyncxxx
content:
asyncxxx.qml:
xxx { asynchronous: true }
where xxx either loader
or image
.
i wonder why not set asynchronous mode default.
most importantly, there way - environment variable, global setting - change default behaviour of built-in components asynchronous one, avoiding custom components?
you make asloader
, asimage
qml types loader
, image
asynchronous: true
, use throughout project. save on having modify everywhere, , if want override that, go , change in prototype.
i wonder why not set asynchronous mode default.
asynchronous more complicated , more overhead, makes sense if not default behavior. qml code i've seen, synchronous used more asynchronous, make little sense make asynchronous default.
edit:
you achieve switching between synchronous , asynchronous behavior during runtime if bind prototype project-wide property, example context property, or property in main.qml
.
Comments
Post a Comment