日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > Android >内容正文

Android

qt on android 桌面鼠标事件,關於Qt on Android,程序安裝到手機,界面只占到一小部分。...

發(fā)布時(shí)間:2025/3/20 Android 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 qt on android 桌面鼠标事件,關於Qt on Android,程序安裝到手機,界面只占到一小部分。... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

環(huán)境為Qt5.7。

手機(jī)界面:

PC界面:

程序如下,手機(jī)為三星I9300,rom為CM13,6.0系統(tǒng)。?想知道如何占滿屏幕

main.cpp

#include?

#include?

#include?

int?main(int?argc,?char?*argv[])

{

QGuiApplication?app(argc,?argv);

QQuickView?viewer;

viewer.setSource(QUrl("qrc:/main.qml"));

viewer.setMinimumSize(QSize(360,?480));

viewer.show();

return?app.exec();

}

mian.qml

import?QtQuick?2.7

import?QtQuick.Window?2.2

import?QtQuick.Controls?2.0

import?QtQuick.Controls.Styles?1.4

import?QtQuick.Dialogs?1.2

Row?{

anchors.rightMargin:?0

anchors.bottomMargin:?0

anchors.leftMargin:?0

anchors.topMargin:?0

anchors.fill:?parent

spacing:?20

Column?{

width:?200

spacing:?16

Text?{

id:?sliderStat

color:?"blue"

text:?"current?-?0.1"

}

Slider?{

width:?200

height:?30

stepSize:?0.01

value:?0.1

onValueChanged:?{

sliderStat.text?=?"current?-?"?+?value

}

}

Slider?{

width:?200

height:?30

orientation:?Qt.Horizontal

clip:?false

visible:?true

from:?0

to:?100

stepSize:?1

value:?50

}

Slider?{

id:?customGrooveAndHandle

width:?200

height:?30

stepSize:?0.1

value:?0

//groove:?Rectangle?{

//}

}

Slider?{

id:?control

value:?0.5

background:?Rectangle?{

x:?control.leftPadding

y:?control.topPadding?+?control.availableHeight?/?2?-?height?/?2

implicitWidth:?200

implicitHeight:?4

width:?control.availableWidth

height:?50//implicitHeight

radius:?2

color:?"#bdbebf"

Rectangle?{

width:?control.visualPosition?*?parent.width

height:?parent.height

color:?"#21be2b"

radius:?2

}

}

handle:?Rectangle?{

x:?control.leftPadding?+?control.visualPosition?*?(control.availableWidth?-?width)

y:?control.topPadding?+?control.availableHeight?/?2?-?height?/?2

implicitWidth:?10

implicitHeight:?50

radius:?10

color:?control.pressed???"#f0f0f0"?:?"#f6f6f6"

border.color:?"#bdbebf"

}

}

Slider?{

id:?control1

value:?0.5

orientation:?Qt.Vertical

background:?Rectangle?{

x:?control1.leftPadding?+?control1.availableWidth?/?2?-?width?/?2

y:?control1.topPadding

implicitWidth:?200?//隱式的

implicitHeight:?200

width:?50

height:?control1.availableHeight//50//implicitHeight

radius:?2

color:?"#bdbebf"

Rectangle?{

width:?parent.width//control1.visualPosition?*?parent.width

height:?control1.visualPosition?*?parent.height

color:?"#21be2b"

radius:?2

}

}

handle:?Rectangle?{

x:?control1.leftPadding?+?control1.availableWidth?/?2?-?width?/?2

y:?control1.bottomPadding?+?control1.visualPosition?*?(control1.availableHeight?-?height)

implicitWidth:?50

implicitHeight:?10

radius:?10

color:?control1.pressed???"#f0f0f0"?:?"#f6f6f6"

border.color:?"#bdbebf"

}

}

}

}

2 個(gè)解決方案

#1

控件屬性設(shè)置下

#2

Qt自帶quickview的例程差不多只要設(shè)置的320*480的,打包進(jìn)手機(jī)運(yùn)行都?只占用手機(jī)左上角320*480,感覺好坑。請(qǐng)問樓主解決了嗎??

總結(jié)

以上是生活随笔為你收集整理的qt on android 桌面鼠标事件,關於Qt on Android,程序安裝到手機,界面只占到一小部分。...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。