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 | [email protected] | 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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
