在QML的UbuntuApplication Context Property
来源:互联网 发布:2017淘宝直通车 编辑:程序博客网 时间:2024/06/16 19:24
我们可以在Ubuntu SDK的文档中可以看到UbuntuApplication API。但是我们看不到它的具体的用法。在这篇文章中,我们来通过如下的方法来查看一下该如何使用该API。
import QtQuick 2.0import Ubuntu.Components 1.1/*! \brief MainView with a Label and Button elements.*/MainView { // objectName for functional testing purposes (autopilot-qt5) objectName: "mainView" // Note! applicationName needs to match the "name" field of the click manifest applicationName: "ubuntuapplication.liu-xiao-guo" /* This property enables the application to change orientation when the device is rotated. The default is false. */ //automaticOrientation: true // Removes the old toolbar and enables new features of the new header. useDeprecatedToolbar: false width: units.gu(60) height: units.gu(85) Page { title: i18n.tr("ubuntuapplication") Text { text: UbuntuApplication.applicationName } Component.onCompleted: { var keys = Object.keys(UbuntuApplication); for(var i = 0; i < keys.length; i++) { var key = keys[i]; // prints all properties, signals, functions from object console.log(key + ' : ' + UbuntuApplication[key]); if (key === "x") { rect[key] = 100; } } } }}
运行我们的应用:
Starting /usr/lib/x86_64-linux-gnu/qt5/bin/qmlscene...qml: objectName : qml: applicationName : ubuntuapplication.liu-xiao-guoqml: objectNameChanged : function() { [code] }qml: applicationNameChanged : function() { [code] }
从上面的输出可以看出来,UbuntuApplication目前没有多少的属性让我们来使用。其中的applicationName,我们也可以使用Qt.application.name来的到。
0 0
- 在QML的UbuntuApplication Context Property
- QML的property所支持的类型
- QML的 property 支持的类型
- 如何在QML应用中创建一个Context Menu
- Spring的properties解析【context:property-placeholder】
- spring的context:property-placeholder属性
- spring3的context:property-placeholder详解
- 浅谈Spring的 context:property-placeholder
- spring的context:property-placeholder属性
- context:property-placeholder
- context:property-placeholder
- context:property-placeholder
- context:property-placeholder
- context:property-placeholder
- context:property-placeholder
- <context:property-placeholder/>作用
- <context:property-placeholder/>使用说明
- 关于<context:property-placeholder>
- org.apache.subversion.javahl.ClientException: svn: E155021: This client is too old to work with the
- #leetcode#Longest Consecutive Sqeuence
- 拉面
- 《柔性字符串匹配》读书笔记(1)之--KMP算法(单模式串匹配、前缀匹配)
- 第七课,分支结构程序体验|三个整数输出最大值 |计算两数正差值|周薪计算
- 在QML的UbuntuApplication Context Property
- 嵌入式Linux系统图形及图形用户界面综述--2005-04-20博客搬家
- linq读写dt
- android删除文件出错
- erlang 压力测试工具 tsung
- Axure实现淡入淡出效果
- Android加载图片导致内存溢出(Out of Memory异常)
- 用SharedPreferences做setting(设置界面)
- 解决spring使用动态代理类型转换失败的问题--java.lang.ClassCastException: com.sun.proxy.$Proxy$ cannot be cast to ...