new experiment with float multiplication
This commit is contained in:
parent
0f0c7f63c2
commit
077ef4cc11
|
@ -7,31 +7,58 @@ import QtQuick.Window 2.11
|
|||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
ColumnLayout {
|
||||
id: sec
|
||||
property real realbase: 10.0
|
||||
property int intbase: realbase
|
||||
|
||||
RowLayout {
|
||||
id: sec
|
||||
property int base: 10
|
||||
|
||||
Text {
|
||||
font.pointSize: sec.base
|
||||
text: "pointSize: " + font.pointSize
|
||||
font.pointSize: sec.intbase
|
||||
text: "int pointSize: " + sec.intbase
|
||||
}
|
||||
|
||||
TextField {
|
||||
text: "pt" + sec.base + "; ptToPx("+sec.base+")"
|
||||
text: "pt" + sec.intbase + "; ptToPx("+sec.intbase+")"
|
||||
style: TextFieldStyle {
|
||||
id: root
|
||||
textColor: "black"
|
||||
font.pointSize: sec.base
|
||||
font.pointSize: sec.intbase
|
||||
property int width: 500
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
implicitWidth: root.width
|
||||
implicitHeight: ptToPx(sec.base)
|
||||
implicitHeight: ptToPx(sec.intbase)
|
||||
//color: windowItem.cwtch_background_color
|
||||
border.color: "#000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Text {
|
||||
font.pointSize: sec.realbase
|
||||
text: "real pointSize: " + sec.realbase
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
26
qml/main.qml
26
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 }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue