qmh_confluence源码研究
licl 01:Confluence.qml 中包含主界面中加载各项目(music等)的操作
var rootMenuItems = [
{ name: qsTr("Music"), mediaPlugin: "music", sourceUrl: "MusicWindow.qml", background: "music.jpg", constructorArgs: { deleteOnClose: true } },
{ name: qsTr("Picture"), mediaPlugin: "picture", sourceUrl: "PictureWindow.qml", background: "pictures.jpg", constructorArgs: { deleteOnClose: true } },
{ name: qsTr("Video"), mediaPlugin: "video", sourceUrl: "VideoWindow.qml", background: "videos.jpg", constructorArgs: { deleteOnClose: true } },
{ name: qsTr("Radio"), mediaPlugin: "radio", sourceUrl: "RadioWindow.qml", background: "music.jpg", constructorArgs: { deleteOnClose: true } },
{ name: qsTr("Snes"), mediaPlugin: "snes", sourceUrl: "SnesWindow.qml", background: "snes.jpg", constructorArgs: { deleteOnClose: true } },
{ name: qsTr("Weather"), sourceUrl: "WeatherWindow.qml", window: _weatherWindow, background: "weather.jpg" },
{ name: qsTr("Web"), sourceUrl: "WebWindow.qml", window: _browserWindow, background: "web.jpg",
onActivate: function() { this.initialUrl = "http://qt.nokia.com"; this.enableBrowserShortcuts = true } },
]
licl 02:Confluence.qml 中包含加载html、qml的app操作
var apps = runtime.apps.findApplications()
for (var idx in apps) {
var path = apps[idx]
var manifest = createQmlObjectFromFile(path + "qmhmanifest.qml")
var uiType = manifest.ui.substring(manifest.ui.lastIndexOf('.')+1)
if (uiType == "qml") {
rootMenuItems.push({ name: manifest.name, appUrl: path + manifest.ui, background: path + manifest.background,
constructorArgs: { deleteOnClose: true }})
runtime.view.addImportPath(path + "imports")
} else if (uiType == "html")
qmhmanifest.qml并不在源码树中,但是个关键的脚本
licl 03:appsmanager.cpp 中有发现app应用的源码实现
QStringList AppsManager::findApplications() const
{
QStringList apps;
foreach(const QString &appSearchPath, LibraryInfo::applicationPaths(m_settings)) {
QStringList subdirs = QDir(appSearchPath).entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
foreach(const QString &subdir, subdirs) {
QString appPath(appSearchPath + '/' + subdir + '/');
QString fileName(appPath + "qmhmanifest.qml"); // look for apps/x/qmhmanifest.qml
QFile prospectiveFile(fileName);
if (prospectiveFile.exists())
apps << (QDir(appPath).absolutePath() + '/');
}
}
return apps;
}
在指定的appSearchPath下,遍历subdirs,找到相应的qmhmanifest.qml,以带文件名的完整路径作为appPath。其中subdirs是由该代码自行检测的
若存在qmhmanifest.qml,则将所有带有此配置文件的所有路径,取其绝对路径(以“/”结尾),保存于apps数组中
licl 03:
createQmlObjectFromFile函数根据配置文件qmhmanifest.qml建立应用对象manifest,从中找出配置文件的规范。——>直接下载应用示例,
另,要找到appSearchPath确定的方法,具体位置。在函数applicationPaths中找——>封装的libraryinfo.cpp中static QStringList standardResourcePaths函数——>三个Qtmediahub路径下的app目录之一均可放置应用程序
在google搜qmhmanifest.qml,找相应的链接。——>直接下载应用示例
licl 03:建立manifest对象之后,利用其成员url作为函数 onActivate: function()的参数启动界面
qmh_confluence源码研究相关推荐
- 一起谈.NET技术,.NET Framework源码研究系列之---万法归宗Object
经过前面三篇关于.NET Framework源码研究系列的随笔,相信大家都发现其实.NET Framework的实现其实并不复杂,也许跟我们自己做的项目开发差不多.本人也是这样的看法.不过,经过仔细深 ...
- Apache Jackrabbit源码研究(五)
上文最后提到jackrabbit的检索默认实现类QueryImpl,先熟悉一下该类的继承层次 QueryImpl继承自抽象类AbstractQueryImpl,而抽象类实现了Query接口(JCR的接 ...
- Nginx源码研究之nginx限流模块详解
这篇文章主要介绍了Nginx源码研究之nginx限流模块详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟随小编过来看看吧 高并发系统有三把利器:缓存.降级和限流: 限流的目的是通过对并 ...
- 转载一篇《Redis源码研究—哈希表》重点是如何重新哈希
<Redis源码研究-哈希表>来自:董的博客 网址:http://dongxicheng.org/nosql/redis-code-hashtable/ 转载于:https://www.c ...
- underscore.js源码研究(5)
概述 很早就想研究underscore源码了,虽然underscore.js这个库有些过时了,但是我还是想学习一下库的架构,函数式编程以及常用方法的编写这些方面的内容,又恰好没什么其它要研究的了,所以 ...
- WebRTC源码研究(4)web服务器工作原理和常用协议基础
文章目录 WebRTC源码研究(4)web服务器工作原理和常用协议基础 前言 做WebRTC 开发为啥要懂服务器开发知识 1. Web 服务器简介 2. Web 服务器的类型 3. Web 服务器的工 ...
- WebRTC源码研究(47)WebRCT传输非音视频数据
文章目录 WebRTC源码研究(47)WebRCT传输非音视频数据 WebRTC源码研究(47)WebRCT传输非音视频数据
- Apache Camel源码研究之Rest
本文以Camel2.24.3 + SpringBoot2.x 为基础简单解读Camel中的Rest组件的源码级实现逻辑. 0. 目录 1. 前言 2. 源码解读 2.1 启动时 2.1.1 `Rest ...
- WebRTC源码研究(7)创建简单的HTTPS服务
文章目录 WebRTC源码研究(7)创建简单的HTTPS服务 1. HTTPS简介 2. HTTPS 协议 3. HTTPS 证书 4. 创建简单的HTTPS服务 4.1 生成HTTPS证书 4.2 ...
- WebRTC源码研究(4)web服务器工作原理和常用协议基础(转载)
前言 前面3篇博客分别对WebRTC框架的介绍,WebRTC源码目录,WebRTC的运行机制进行了介绍,接下来讲解一点关于服务器原理的知识.后面博客会写关于WebRTC服务器相关的开发,目前git上面 ...
最新文章
- 【Linux 内核 内存管理】内存管理架构 ① ( 内存管理架构组成 | 用户空间 | 内核空间 | MMU 硬件 | Linux 内核架构层次 | Linux 系统调用接口 )
- QuickFlow之任务代理-TaskDelegation
- React开发(141):react中ref为class添加ref
- go如何进行交叉编译
- Spring Boot 2 快速教程:WebFlux 集成 Thymeleaf 、 Mongodb 实践(六)
- delphi DBgrid 使用大全
- 百度地图开发只显示网格不显示地图信息
- 实习成长之路——设计模式实战二:如何使用面向对象的思想设计一个功能需求?接口鉴权怎么用面向对象分析实现?
- 【矩阵论】对称矩阵特征值的性质与直积
- VMware虚拟机磁盘扩容
- 软件开发工具【十四】 之 常用建模工具
- hairline!ios实现边框0.5px
- credential provider filter注意
- 《开源安全运维平台OSSIM最佳实践》媒体推荐
- mysql脏写_图解脏写、脏读、不可重复读、幻读
- 在Codesys用ST语言基于数组实现栈LIFO数据结构详细说明+代码实例
- 【Python】 matplotlib 以pdf形式保存图片
- 我喜欢的photo,images....
- Anaconda3、TensorFlow和keras简单安装方法(较详细)
- 文墨绘学:习惯决定孩子命运—习惯培养的五大步骤