diff --git a/qml/TestRow.qml b/qml/TestRow.qml index d23ea41..dae87ff 100644 --- a/qml/TestRow.qml +++ b/qml/TestRow.qml @@ -7,30 +7,57 @@ import QtQuick.Window 2.11 import QtQuick.Controls.Styles 1.4 import QtQuick.Controls 1.4 - -RowLayout { +ColumnLayout { id: sec - property int base: 10 + property real realbase: 10.0 + property int intbase: realbase - Text { - font.pointSize: sec.base - text: "pointSize: " + font.pointSize + RowLayout { + Text { + font.pointSize: sec.intbase + text: "int pointSize: " + sec.intbase + } + + TextField { + text: "pt" + sec.intbase + "; ptToPx("+sec.intbase+")" + style: TextFieldStyle { + id: root + textColor: "black" + font.pointSize: sec.intbase + property int width: 500 + + background: Rectangle { + radius: 2 + implicitWidth: root.width + implicitHeight: ptToPx(sec.intbase) + //color: windowItem.cwtch_background_color + border.color: "#000000" + } + } + } } - TextField { - text: "pt" + sec.base + "; ptToPx("+sec.base+")" - style: TextFieldStyle { - id: root - textColor: "black" - font.pointSize: sec.base - property int width: 500 + RowLayout { + Text { + font.pointSize: sec.realbase + text: "real pointSize: " + sec.realbase + } - background: Rectangle { - radius: 2 - implicitWidth: root.width - implicitHeight: ptToPx(sec.base) - //color: windowItem.cwtch_background_color - border.color: "#000000" + TextField { + text: "pt" + sec.realbase + "; ptToPx("+sec.realbase+")" + style: TextFieldStyle { + id: root + textColor: "black" + font.pointSize: sec.realbase + property int width: 500 + + background: Rectangle { + radius: 2 + implicitWidth: root.width + implicitHeight: ptToPx(sec.realbase) + //color: windowItem.cwtch_background_color + border.color: "#000000" + } } } } diff --git a/qml/main.qml b/qml/main.qml index 788e7e7..3c7ac62 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -26,11 +26,25 @@ ApplicationWindow { } ColumnLayout { - Text { text: "Screen.pixelDensity: " + Screen.pixelDensity } - TestRow { base: 10 } - TestRow { base: 16 } - TestRow { base: 24 } - TestRow { base: 36 } - TestRow { base: 48 } + id: col + property real scale: 1.5 + + Text { text: "Screen.pixelDensity: " + Screen.pixelDensity + ", col.scale: " + col.scale} + Slider { + id: zoomSlider + minimumValue: 0.5 + maximumValue: 4.0 + value: col.scale + updateValueWhileDragging: true + onValueChanged: { + col.scale = zoomSlider.value + } + width: 400 + } + TestRow { realbase: 10 * col.scale } + TestRow { realbase: 16 * col.scale } + TestRow { realbase: 24 * col.scale } + TestRow { realbase: 36 * col.scale } + TestRow { realbase: 48 * col.scale } } } \ No newline at end of file