Improve startup of bindings using QQuickScreen
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Wed, 29 Oct 2014 08:58:03 +0000 (09:58 +0100)
committerShawn Rutledge <shawn.rutledge@digia.com>
Mon, 12 Jan 2015 20:22:35 +0000 (21:22 +0100)
commit6b808b1eee4956286995ad9b1c2e81ae4b1a5884
tree1d8af49173d374ba65e5c7f518b1d6cc8a33c754
parentc5b575bdc26b54e4807760c9731e9b9752f56f21
Improve startup of bindings using QQuickScreen

We can optimistically initialize the underlying QScreen to the primary
screen and this way ensure that in the common case the evaluation of
bindings using the screen's attached properties results in correct calculations
on startup. This way we can avoid re-evaluating the bindings again later.

Previously on startup all the returned values were zero and the bindings got
evaluated again once a window was assigned.

Change-Id: I98ba5905953f0b5054d924919239d178570250d3
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/items/qquickscreen.cpp
tests/auto/quick/qquickscreen/tst_qquickscreen.cpp