qml - Adjust application resolution for mobile screens -
hello have tried adjust qml app mobile screens. have main screen consists of tabs in tabview :
import qtquick 2.5 import qtquick.window 2.1 import qtquick.layouts 1.1 import qtquick.controls 1.1 import qtquick.controls.styles 1.4 tabview { tab{ id: tab1 component: qt.createcomponent("qrc:///loginscreen.qml")} tab{ id: tab1 component: qt.createcomponent("qrc:///afterlogged.qml")}}` in loginscreen.qml in have buttons, labels, textfields data:
import qtquick 2.5 import qtquick.window 2.1 import qtquick.layouts 1.1 import qtquick.controls 1.1 import qtquick.controls.styles 1.4 item { label { id: ipaddresslabel text: qstr("address ip:") textfield { id: iptextfield placeholdertext: qstr("insert ip address") button { id: loginbtn onclicked: { connecttoapp(iptextfield.text)}} } how resize app screen on basis of specific mobile screen resolution/density?
just have @ screen type.
it contains current height , width of screen can assigned loginscreen.qml width , height properties:
item { width: screen.width height: screen.height //[...] } please note if want use anchors margins have go step deeper , calculate margins correctly.
Comments
Post a Comment