From a34eddbf7a68360ead218b2f5a9215e6b1ae88ec Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 16 Dec 2013 10:58:05 +0100 Subject: 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 --- examples/quick/window/ScreenInfo.qml | 4 ++-- examples/quick/window/window.qml | 3 ++- 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) } -- cgit v1.2.3