aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/window
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-12-16 10:58:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-18 13:14:34 +0100
commita34eddbf7a68360ead218b2f5a9215e6b1ae88ec (patch)
tree13343c25b48c8dcca0e38495014f658c757c6742 /examples/quick/window
parentccaa64ffd44faedbfe7297680939b40327bc5334 (diff)
QtQuick window example improvements: window size and DPI info
On high-resolution displays it's important to size the window so that the content will fit. Also show the DPI conversion for pixel density. Change-Id: Ie35852ecff0bb0ee5ab9b77c6c18e82cfc300448 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'examples/quick/window')
-rw-r--r--examples/quick/window/ScreenInfo.qml4
-rw-r--r--examples/quick/window/window.qml3
2 files changed, 4 insertions, 3 deletions
diff --git a/examples/quick/window/ScreenInfo.qml b/examples/quick/window/ScreenInfo.qml
index e422a51a71..73700720d8 100644
--- a/examples/quick/window/ScreenInfo.qml
+++ b/examples/quick/window/ScreenInfo.qml
@@ -80,10 +80,10 @@ Item {
Text { text: Screen.width + "x" + Screen.height }
Text { text: "pixel density" }
- Text { text: Screen.pixelDensity.toFixed(2) + " dots/mm" }
+ Text { text: Screen.pixelDensity.toFixed(2) + " dots/mm (" + (Screen.pixelDensity * 25.4).toFixed(2) + " dots/inch)" }
Text { text: "logical pixel density" }
- Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm" }
+ Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm (" + (Screen.logicalPixelDensity * 25.4).toFixed(2) + " dots/inch)" }
Text { text: "available virtual desktop" }
Text { text: Screen.desktopAvailableWidth + "x" + Screen.desktopAvailableHeight }
diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml
index 00daec7ff1..7bb2ce6cac 100644
--- a/examples/quick/window/window.qml
+++ b/examples/quick/window/window.qml
@@ -47,7 +47,7 @@ QtObject {
property SystemPalette palette: SystemPalette { }
property var controlWindow: Window {
- width: 400
+ width: visibilityLabel.implicitWidth * 1.2
height: col.implicitHeight + defaultSpacing * 2
color: palette.window
title: "Control Window"
@@ -122,6 +122,7 @@ QtObject {
return "unknown";
}
Text {
+ id: visibilityLabel
text: "second window is " + (testWindow.visible ? "visible" : "invisible") +
" and has visibility " + parent.visibilityToString(testWindow.visibility)
}