Qt 5.6 的 Qt.labs.controls 在安卓上效果
2016-03-22 13:46
567 查看
Qt 5.6 的 Qt.labs.controls 在安卓上效果
Qt 5.6 发布也有一段时间了。其中的QtQuick.Controls 2.0也以技术预览的方式发布出来。
这里给大家一睹为快。
测试代码如下:
import QtQuick 2.6 import QtQuick.Window 2.2 import Qt.labs.controls 1.0 import QtQuick.Layouts 1.3 ApplicationWindow { id: mainWindow visible: true width: 360 height: 640 // font.pointSize: 20 起步 font.pointSize: slider.value * 50 Drawer { //edge: Qt.TopEdge Rectangle { width: mainWindow.width * 0.8 height: mainWindow.height color: "red" } } SwipeView { id: view anchors.fill: parent currentIndex: 2 Item { id: firstPage ButtonGroup { buttons: column.children } Column { id: column RadioButton { checked: true text: qsTr("DAB") } RadioButton { text: qsTr("FM") } RadioButton { text: qsTr("AM") } } } Item { id: secondPage Button { text: "Button" } } Item { id: thirdPage Flow { width: parent.width height: parent.height Switch { text: qsTr("Wi-Fi") } RangeSlider { first.value: 0.25 second.value: 0.75 } CheckBox { checked: true text: qsTr("First") } Button { text: "Button" onClicked: { } } Dial { Keys.onLeftPressed: {} } Frame { ColumnLayout { anchors.fill: parent CheckBox { text: qsTr("E-mail") } CheckBox { text: qsTr("Calendar") } CheckBox { text: qsTr("Contacts") } } } ProgressBar { value: 0.5 } Label { text: mainWindow.font.pixelSize+ "," + mainWindow.font.pointSize } Slider { id: slider value: 0.5 width: parent.width } } } } PageIndicator { id: indicator count: view.count currentIndex: view.currentIndex anchors.bottom: view.bottom anchors.horizontalCenter: parent.horizontalCenter } }
在 Window 7 上测试时,抽屉(
Drawer)控件是有效的,但是在安卓上就无法拖出抽屉控件。控件风格默认以灰色为主格调。
在安卓下的效果:
可以看出,默认的控件在安卓上,大小偏小。
通过设置
ApplicationWindow::font.pointSize来控制控件中字体的大小。
字体大小改变了,但是控件本身没有变动。看来还得多段时间的发展。
此外,在 Window 7 上测试代码时,如果使用
BusyIndicator或者
ComboBox有一定概率无法退出程序,或者程序会奔溃。
相关文章推荐
- php结合安卓客户端实现查询交互实例
- Android安卓中循环录像并检测内存卡容量
- 在安卓系统中插入表情到光标位置的代码详解
- Almp 安卓系统上搭建本地php服务器环境的步骤
- 谷歌被屏蔽后如何搭建安卓环境
- 安卓APP测试之使用Burp Suite实现HTTPS抓包方法
- 安卓(Android)聊天机器人实现代码分享
- Android中Fragment的生命周期与返回栈的管理
- 分享一个安卓的内置多种工具类的Activity
- 安卓系统中实现摇一摇画面振动效果的方法
- java实现获取安卓设备里已安装的软件包
- 安卓(Android)中如何实现滑动导航
- 六款值得推荐的android(安卓)开源框架简介
- 关于安卓so的兼容性的简单说明
- android(安卓)开源框架——六款【转】
- java.lang.NoClassDefFoundError: org.apache.axis.cl
- 开发阶段总结