new experiment with float multiplication

This commit is contained in:
erinn 2019-09-18 13:09:07 -07:00
parent 0f0c7f63c2
commit 077ef4cc11
2 changed files with 66 additions and 25 deletions

View File

@ -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"
}
}
}
}

View File

@ -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 }
}
}