diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-01-16 13:44:41 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 07:55:00 +0100 |
commit | d758f3aac6c8a15d1b346ea961e820e7247af20b (patch) | |
tree | 641f0c3ae73d4c9c0c05530100a59df4dd67264f /examples/declarative | |
parent | 5180186da2644c06c339083a10aab36ed11cf273 (diff) |
Update Screen example
DPI API never made it into the final API, because there were more issues
than valid usecases.
Change-Id: Ie56465145461486456462154dfafe546fedaddee
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/window/screen/screenInfo.qml (renamed from examples/declarative/window/screen/ruler.qml) | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/examples/declarative/window/screen/ruler.qml b/examples/declarative/window/screen/screenInfo.qml index 905d729b05..495681342e 100644 --- a/examples/declarative/window/screen/ruler.qml +++ b/examples/declarative/window/screen/screenInfo.qml @@ -43,10 +43,8 @@ import QtQuick.Window 2.0 as Window Item { id: root - width: 800 - height: dpi + dpcm - property real dpcm: Window.Screen.physicalDotsPerInch / 2.54 - property real dpi: Window.Screen.physicalDotsPerInch + width: 400 + height: 200 Item { id: main state: "orientation " + Window.Screen.currentOrientation @@ -61,42 +59,11 @@ Item { height: main.baseHeight anchors.centerIn: parent - Repeater { - model: Math.ceil(main.width/ dpcm) + 1 - delegate: Rectangle{ - border.width: 1 - color: "goldenrod" - width: dpcm - height: dpcm - x: dpcm * (index - 1) - Text { - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 2 - font.pointSize: 6 - text: index + " cm" - } - } + Text { + text: "Screen is " + Window.Screen.width + "x" + Window.Screen.height + " and primarily orientation " + Window.Screen.primaryOrientation + anchors.centerIn:parent } - Repeater { - model: Math.ceil(main.width / dpi) + 1 - delegate: Rectangle{ - border.width: 1 - color: "goldenrod" - width: dpi - height: dpi - x: dpi * (index - 1) - y: dpcm - Text { - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 2 - font.pointSize: 8 - text: index + " in" - } - } - } states: [ State { |