虽然我们的developer站点有丰富的API介绍,可是,有些API的介绍可能并不全,有些API也在不断地演进中。

为了得到更具体的API,我们能够通过例如以下的命令来得到更加具体的信息。比方我们对“SingleDownload”API来得到更加多的信息。

$qmlplugindump Ubuntu.DownloadManager 0.1

显示的结果例如以下:

import QtQuick.tooling 1.1





// This file describes the plugin-supplied types contained in the library.

// It is used for QML tooling purposes only.

//

// This file was auto-generated by:

// 'qmlplugindump Ubuntu.DownloadManager 0.1'





Module {

    Component {

        name: "Ubuntu::DownloadManager::DownloadError"

        prototype: "QObject"

        exports: ["Error 0.1"]

        exportMetaObjectRevisions: [0]

        Property { name: "type"; type: "string"; isReadonly: true }

        Property { name: "message"; type: "string"; isReadonly: true }

    }

    Component {

        name: "Ubuntu::DownloadManager::SingleDownload"

        prototype: "QObject"

        exports: ["SingleDownload 0.1"]

        exportMetaObjectRevisions: [0]

        Property { name: "autoStart"; type: "bool" }

        Property { name: "errorMessage"; type: "string"; isReadonly: true }

        Property { name: "isCompleted"; type: "bool"; isReadonly: true }

        Property { name: "downloadInProgress"; type: "bool"; isReadonly: true }

        Property { name: "allowMobileDownload"; type: "bool" }

        Property { name: "throttle"; type: "qulonglong" }

        Property { name: "progress"; type: "int"; isReadonly: true }

        Property { name: "downloading"; type: "bool"; isReadonly: true }

        Property { name: "downloadId"; type: "string"; isReadonly: true }

        Property { name: "headers"; type: "QVariantMap" }

        Signal {

            name: "canceled"

            Parameter { name: "success"; type: "bool" }

        }

        Signal {

            name: "finished"

            Parameter { name: "path"; type: "string" }

        }

        Signal {

            name: "paused"

            Parameter { name: "success"; type: "bool" }

        }

        Signal {

            name: "processing"

            Parameter { name: "path"; type: "string" }

        }

        Signal {

            name: "progressReceived"

            Parameter { name: "received"; type: "qulonglong" }

            Parameter { name: "total"; type: "qulonglong" }

        }

        Signal {

            name: "resumed"

            Parameter { name: "success"; type: "bool" }

        }

        Signal {

            name: "started"

            Parameter { name: "success"; type: "bool" }

        }

        Signal {

            name: "errorFound"

            Parameter { name: "error"; type: "DownloadError&" }

        }

        Signal { name: "errorChanged" }

        Method {

            name: "registerError"

            Parameter { name: "error"; type: "Error"; isPointer: true }

        }

        Method {

            name: "bindDownload"

            Parameter { name: "download"; type: "Download"; isPointer: true }

        }

        Method {

            name: "unbindDownload"

            Parameter { name: "download"; type: "Download"; isPointer: true }

        }

        Method {

            name: "onFinished"

            Parameter { name: "path"; type: "string" }

        }

        Method {

            name: "onProgress"

            Parameter { name: "received"; type: "qulonglong" }

            Parameter { name: "total"; type: "qulonglong" }

        }

        Method {

            name: "onPaused"

            Parameter { name: "wasPaused"; type: "bool" }

        }

        Method {

            name: "onResumed"

            Parameter { name: "wasResumed"; type: "bool" }

        }

        Method {

            name: "onStarted"

            Parameter { name: "wasStarted"; type: "bool" }

        }

        Method {

            name: "onCanceled"

            Parameter { name: "wasCanceled"; type: "bool" }

        }

        Method { name: "start" }

        Method { name: "pause" }

        Method { name: "resume" }

        Method { name: "cancel" }

        Method {

            name: "download"

            Parameter { name: "url"; type: "string" }

        }

    }

    Component {

        name: "Ubuntu::DownloadManager::UbuntuDownloadManager"

        prototype: "QObject"

        exports: ["DownloadManager 0.1"]

        exportMetaObjectRevisions: [0]

        Property { name: "autoStart"; type: "bool" }

        Property { name: "cleanDownloads"; type: "bool" }

        Property { name: "errorMessage"; type: "string"; isReadonly: true }

        Property { name: "downloads"; type: "QVariantList"; isReadonly: true }

        Signal { name: "errorChanged" }

        Method {

            name: "download"

            Parameter { name: "url"; type: "string" }

        }

    }

}

我们通过使用“finished”信号能够得到下载完毕的事件而进行分别的处理!

另外一个样例(Push notification)

liuxg@liuxg:~$ qmlplugindump Ubuntu.PushNotifications 0.1
import QtQuick.tooling 1.1 // This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump Ubuntu.PushNotifications 0.1' Module {
Component {
name: "PushClient"
prototype: "QObject"
exports: ["PushClient 0.1"]
exportMetaObjectRevisions: [0]
Property { name: "appId"; type: "string" }
Property { name: "token"; type: "string"; isReadonly: true }
Property { name: "notifications"; type: "QStringList"; isReadonly: true }
Property { name: "status"; type: "string"; isReadonly: true }
Property { name: "persistent"; type: "QStringList"; isReadonly: true }
Property { name: "count"; type: "int" }
Signal {
name: "countChanged"
Parameter { type: "int" }
}
Signal {
name: "notificationsChanged"
Parameter { type: "QStringList" }
}
Signal {
name: "persistentChanged"
Parameter { type: "QStringList" }
}
Signal {
name: "appIdChanged"
Parameter { type: "string" }
}
Signal {
name: "error"
Parameter { type: "string" }
}
Signal {
name: "tokenChanged"
Parameter { type: "string" }
}
Signal {
name: "statusChanged"
Parameter { type: "string" }
}
Method { name: "getNotifications" }
Method {
name: "notified"
Parameter { name: "appId"; type: "string" }
}
Method { name: "emitError" }
Method {
name: "clearPersistent"
Parameter { name: "tags"; type: "QStringList" }
}
}
}

怎样得到QML package的具体API接口的更多相关文章

  1. 总结的一些微信API接口

    本文给大家介绍的是个人总结的一些微信API接口,包括微信支付.微信红包.微信卡券.微信小店等,十分的全面,有需要的小伙伴可以参考下. 1. [代码]index.php <?php include ...

  2. 公交线路免费api接口代码

    描写叙述:本接口主要是依据城市名称 +  线路名称 模糊查找城市公交线路信息. 开源api接口:http://openapi.aibang.com/bus/lines?app_key=keyvalue ...

  3. SpringMVC Restful api接口实现

    [前言] 面向资源的 Restful 风格的 api 接口本着简洁,资源,便于扩展,便于理解等等各项优势,在如今的系统服务中越来越受欢迎. .net平台有WebAPi项目是专门用来实现Restful ...

  4. hbase rest api接口链接管理【golang语言版】

    # go-hbase-resthbase rest api接口链接管理[golang语言版]关于hbase的rest接口的详细信息可以到官网查看[http://hbase.apache.org/boo ...

  5. MxNet+R︱用R语言实现深度学习(单CPU/API接口,一)

    MxNet有了亚马逊站台之后,声势大涨,加之接口多样化,又支持R语言所以一定要学一下.而且作为R语言的fans,为啥咱们R语言就不能上深度学习嘞~ -------------------------- ...

  6. Spring Boot入门(四):开发Web Api接口常用注解总结

    本系列博客记录自己学习Spring Boot的历程,如帮助到你,不胜荣幸,如有错误,欢迎指正! 在程序员的日常工作中,Web开发应该是占比很重的一部分,至少我工作以来,开发的系统基本都是Web端访问的 ...

  7. 使用go, gin, gorm编写一个简单的curd的api接口

    go 是一门非常灵活的语言,既具有静态语言的高性能,又有动态语言的开发速度快的优点,语法也比较简单,下面是通过简单的代码实现了一个简单的增删改查 api 接口 hello world 常规版 新建 d ...

  8. Java 调用Restful API接口的几种方式--HTTPS

    摘要:最近有一个需求,为客户提供一些Restful API 接口,QA使用postman进行测试,但是postman的测试接口与java调用的相似但并不相同,于是想自己写一个程序去测试Restful ...

  9. springcloud提供开放api接口签名验证

    一.MD5参数签名的方式 我们对api查询产品接口进行优化: 1.给app分配对应的key.secret 2.Sign签名,调用API 时需要对请求参数进行签名验证,签名方式如下: a. 按照请求参数 ...

随机推荐

  1. 2018.8.6 Noip2018模拟测试赛(十九)

    日期: 八月六号  总分: 300分  难度: 提高 ~ 省选    得分: 10分(MMP) 题目目录: T1:Tree T2:异或运算 T3:Tree Restoring 赛后反思: Emmmmm ...

  2. SPOJ QTREE3 - Query on a tree again!

    You are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are number ...

  3. javascript总for of和for in的区别?

    for in是ES5标准,for of是ES6标准; for in是遍历对象属性,for of是遍历对象元素. for of兼容性还不够,移动端安卓微信浏览器貌似不支持,苹果的可以;web端IE支持也 ...

  4. 如何通过ShareSDK的 Unity3D快速接入Android/iOS分享与授权

    Unity3D是由Unity Technologies开发的一个让玩家轻松创建诸如三维视频游戏.建筑可视化.实时三维动画等类型互动内容的多平台的综合型游戏开发工具,是一个全面整合的专业游戏引擎:在游戏 ...

  5. jdk1.8中nashorn不支持ECMAScript6的问题

    背景 在项目中需要使用java调用javascript脚本,有两种方案,一种是faas,使用开源的openwhisk.另一种本地运行的方式,使用jdk的nashorn调用javascript,jdk版 ...

  6. Windows Server 2003中报PerfDisk “无法从系统读取磁盘性能信息。

    Windows Server 2003中报PerfDisk “无法从系统读取磁盘性能信息.”的问题解决 2015-01-22 09:49:02 标签:Windows Server2003 PerfDi ...

  7. Android减少布局层次--有关Activity根视图DecorView的思考

    1 Android应用图层 一直觉得有关DecorView还是有些问题没有搞清楚,今天在看了一点有关SurfaceFlinger的内容以后,顿时突发奇想,想到之前的问题,之前的思考是: 虽然可以将De ...

  8. android的窗口机制分析------UI管理系统

    Activity可以看做是整个Android系统的人机接口,它提供了一个窗口来绘制UI,每个Activity在启动时,我们都需要给它设置一个Content view,作为Activity所呈现的UI内 ...

  9. 在Android Studio下使用Hierarchy Viewer

    前言 最近看到这篇文章<Android UI性能优化详解>,里面使用了Hierarchy Viewer来对布局进行优化.开发android这么久了,一直都有听过这个工具,但是重来都没真正去 ...

  10. Java HashMap学习笔记

    1.HashMap数据结构 在java编程语言中,最基本的结构就是两种,一个是数组,另外一个是模拟指针(引用),所有的数据结构都可以用这两个基本结构来构造的,HashMap也不例外.HashMap实际 ...