[Development] OpenGL drivers

Thomas McGuire thomas.mcguire at kdab.com
Wed Dec 4 16:49:26 CET 2013


Hi,

On Wednesday 04 December 2013 11:47:29 Sletta Gunnar wrote:
> If we added conversion functions for inch(), cm(), mm(), points() to
> QQuickItem, it could look up its current window/screen object and figure
> out the relationship between each unit for the screen the item is on and
> just set that. The app can then layout in the unit space it prefers with
> information readily available. 
> 
> Text { 
>     font.pixelSize: cm(0.5);
>     anchors.left: parent.left
>     anchors.margins: cm(0.25);
> }
> 
> 
> Making them functions makes it impossible to listen for screen changes
> which in turn trigger dpi changes so they would have to be properties...
> 
> Text {
>     font.pixelSize: 0.5 * cm;
>     anchors.left: parent.left
>     anchors.margins: 0.25 * cm;
> }

Interesting, the cm() function is another example that shows the need for 
functions having NOTIFY signals.
The other example is qsTr(), since you want to have updates when the language 
changes. Although for qsTr(), there is a patch somewhere that adds support for 
just that in the QML engine, a generic mechanism for NOTIFY support in 
functions would be nice.

Regards,
Thomas
-- 
Thomas McGuire | thomas.mcguire at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131204/80158a11/attachment.sig>


More information about the Development mailing list