fixes
This commit is contained in:
parent
077ef4cc11
commit
b03846f1a2
4
main.go
4
main.go
|
@ -42,8 +42,10 @@ func main() {
|
|||
qmlSource = core.NewQUrl3("qrc:/qml/main.qml", 0)
|
||||
}
|
||||
|
||||
core.QCoreApplication_SetAttribute(core.Qt__AA_Use96Dpi, true)
|
||||
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, false)
|
||||
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
||||
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
|
||||
//QApplication::setAttribute(Qt::AA_Use96Dpi);
|
||||
quickcontrols2.QQuickStyle_SetStyle("Default")
|
||||
engine := qml.NewQQmlApplicationEngine(nil)
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ ColumnLayout {
|
|||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
implicitWidth: root.width
|
||||
implicitHeight: ptToPx(sec.intbase)
|
||||
//color: windowItem.cwtch_background_color
|
||||
//implicitWidth: root.width
|
||||
//implicitHeight: ptToPx(sec.intbase)
|
||||
color: "#DDDDFF"
|
||||
border.color: "#000000"
|
||||
}
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ ColumnLayout {
|
|||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
implicitWidth: root.width
|
||||
implicitHeight: ptToPx(sec.realbase)
|
||||
//color: windowItem.cwtch_background_color
|
||||
//implicitWidth: root.width
|
||||
//implicitHeight: ptToPx(sec.realbase)
|
||||
color: "#DDDDFF"
|
||||
border.color: "#000000"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ ApplicationWindow {
|
|||
}
|
||||
|
||||
function ptToPx(pt) {
|
||||
return Screen.pixelDensity * 25.4 * pt / 72
|
||||
return Screen.pixelDensity * 25.4 * Math.round(pt) / 72
|
||||
}
|
||||
|
||||
function pxToPt(px) {
|
||||
return px * 72 / (Screen.pixelDensity * 25.4)
|
||||
return Math.round(px) * 72 / (Screen.pixelDensity * 25.4)
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
Loading…
Reference in New Issue