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.Styles 1.4
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
ColumnLayout {
RowLayout {
id: sec id: sec
property int base: 10 property real realbase: 10.0
property int intbase: realbase
Text { RowLayout {
font.pointSize: sec.base Text {
text: "pointSize: " + font.pointSize 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 { RowLayout {
text: "pt" + sec.base + "; ptToPx("+sec.base+")" Text {
style: TextFieldStyle { font.pointSize: sec.realbase
id: root text: "real pointSize: " + sec.realbase
textColor: "black" }
font.pointSize: sec.base
property int width: 500
background: Rectangle { TextField {
radius: 2 text: "pt" + sec.realbase + "; ptToPx("+sec.realbase+")"
implicitWidth: root.width style: TextFieldStyle {
implicitHeight: ptToPx(sec.base) id: root
//color: windowItem.cwtch_background_color textColor: "black"
border.color: "#000000" 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 { ColumnLayout {
Text { text: "Screen.pixelDensity: " + Screen.pixelDensity } id: col
TestRow { base: 10 } property real scale: 1.5
TestRow { base: 16 }
TestRow { base: 24 } Text { text: "Screen.pixelDensity: " + Screen.pixelDensity + ", col.scale: " + col.scale}
TestRow { base: 36 } Slider {
TestRow { base: 48 } 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 }
} }
} }