# HG changeset patch # User sl # Date 1401300863 -7200 # Node ID 40da62e57d85cabbbf3b0b89c27c48795276d54b # Parent f0c61338a2e8d9fe3ca7ba6f9bf3a7fae96a035c Fixing qml warnings. diff -r f0c61338a2e8 -r 40da62e57d85 DisplayTab.qml --- a/DisplayTab.qml Wed May 28 19:31:55 2014 +0200 +++ b/DisplayTab.qml Wed May 28 20:14:23 2014 +0200 @@ -15,14 +15,13 @@ Component.onCompleted: { display.closing.connect(onDisplayClosing); display.opened.connect(onDisplayOpened); + appWindow.closing.connect(onWindowClosing); if(checkBoxConnectOnStartUp.checked) display.open() } //We need to disconnect our signals to avoid receiving stray events Component.onDestruction: { - display.closed.disconnect(onDisplayClosing); - display.opened.disconnect(onDisplayOpened); - onDisplayClosing(); + disconnectDisplaySignals() } // Settings { @@ -32,31 +31,44 @@ property alias brightness: sliderBrightness.value; } + function disconnectDisplaySignals() + { + display.closed.disconnect(onDisplayClosing); + display.opened.disconnect(onDisplayOpened); + } + + //Clear both front and back buffers + function clearBuffers() + { + display.clear(); + display.swapBuffers(); + display.clear(); + display.swapBuffers(); + } + + function onWindowClosing() + { + //Clear both our frames + onDisplayClosing(); + disconnectDisplaySignals(); + } + function onDisplayClosing() { - //Clear both our frames - if (checkBoxClearWhenDisconnecting.checked) + if (checkBoxClearWhenDisconnecting != null && checkBoxClearWhenDisconnecting.checked) { - display.clear(); - display.swapBuffers(); - display.clear(); - display.swapBuffers(); + clearBuffers(); } } function onDisplayOpened() { - //Clear both our frames if (checkBoxClearWhenConnecting.checked) { - display.clear(); - display.swapBuffers(); - display.clear(); - display.swapBuffers(); + clearBuffers(); } } - // Column { diff -r f0c61338a2e8 -r 40da62e57d85 FontsTab.qml --- a/FontsTab.qml Wed May 28 19:31:55 2014 +0200 +++ b/FontsTab.qml Wed May 28 20:14:23 2014 +0200 @@ -46,7 +46,7 @@ anchors.margins: 8 spacing: 8 - Text { + Label { id: fontLabel text: "Current font: " + textFontDemoLowerCase.font.family + " - " + textFontDemoLowerCase.font.pointSize +"" MouseArea { @@ -59,21 +59,21 @@ anchors.margins: 0 spacing: 0 - Text { + Label { id: textFontDemoLowerCase anchors.margins: 0 text: "abcdefghijklmnopqrstyvwxyz" font: Qt.font({ family: "Arial", pointSize: 16, weight: Font.Normal }) } - Text { + Label { id: textFontDemoUpperCase anchors.margins: 0 text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ" font: textFontDemoLowerCase.font } - Text { + Label { id: textFontDemoDigits anchors.margins: 0 text: "0123456789"