首页计算机书籍计算机语言《Developing MeeGo apps with Python and QML》Thomas Perl
严亦超

文档

234

关注

0

好评

0
PDF

《Developing MeeGo apps with Python and QML》Thomas Perl

阅读 921 下载 0 大小 851.31K 总页数 28 页 2022-09-27 分享
价格:¥ 10.00
下载文档
/ 28
全屏查看
《Developing MeeGo apps with Python and QML》Thomas Perl
还有 28 页未读 ,您可以 继续阅读 或 下载文档
1、本文档共计 28 页,下载后文档不带www.pdfdz.com水印,支持完整阅读内容。
2、古籍基本都为PDF扫描版,所以文档不支持编辑功能,即不支持文档内文字的复制粘贴。
3、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
4、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
5、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。
Developing MeeGo appswith Python and QMLby Thos Perl ://thp.io/2010/meego-python/Table of ContentsIntroduction........3Why should I use Python to develop MeeGo apps?.3Setting up the environment............3Getting the build scripts............................4Building PySide and installing into $HOME...........................................4Setting up environment variables.........................5Testing the installations........5Basic QML tutorial examples....................6Hello World.......6The Python source (HelloMeeGo.py)..................................................6The QML UI file (HellomeeGo.qml)...............................8Displaying HTML content in a QML WebView...................................9The Python source code (WebKitview.py)..........................................9The HTML page (WebKitview.html).............11Writing a new QML UI for existing apps for MeeGo..................................13The glue layer in Python (gpodder-qml.py)..........................................1.4The QML in Ul file (gpodder-qml.qml)..............18The QML file for displaying a list of podcasts(PodcastList.qml)..21The QML file for displaying a list of episodes (EpisodeList.qml).............24Packaging a Python application for MeeGo.......................................25Installing the required dependencies...............25Creating the required metadata files...............25The desktop entry:gpodder-qml.desktop..........................................25The icon for the app menu:gpodder-qml.png........................................25The Spectacle YAML file:gpodder-qml.yaml.......................................26The Python distutils file:setup.py........26Changes in the gpodder-qml.py script..................................26Creating the RPM sources..27Building the RPM package from source.....2Installing and testing the RPM package....................27IntroductionThis tutorial will guide you through how to set up a PySide environment on yourMeeGo Netbook and then show you some basics through examples,and finallywe'll create a QML Ul for an existing application(gPodder)that can be used onMeeGo Netbook and MeeGo Handset.Why should I use Python to develop MeeGo apps?Low barrier to entry:Python is a very easy to leamn language,so you canget quickly up to speed-independent of whether or not you are alreadyfamiliar with other languagesGarbage collection:You don't have to nually nage the memory ofthe objects you create-the Python garbage collector takes care ofremoving no longer needed objectsNo compiling:Python is an interpreted language,so you can run yourapplication right after saving the source in an editor.No need to wait forcode to compile.This is especially important on low-powered netbooks.Full access to the Qt libraries:PySide bindings allow access to all modulesof Qt.And because it uses the native Qt libraries,library functions run atnative (compiled)speed.Shorter code:In my experience,C++applications using Qt have about 3times as much lines of code as the equivalent Python applications-usingthe same libraries and Qt classes!Prototyping:Even if you plan on writing a C++Qt application,Python andPySide are a great combination for quickly prototyping your ideas.Thiscould be useful to prototype a C++backend of your QML application.Later on,you just exchange the Python backend with a C++backend andcan reuse the QML files from the Python app.Development on the go:As Python is an interpreted language,theruntime already contains all the necessary tools to develop applications,so you don't have to install a compiler,development libraries and headerfiles just to create apps-it's instant,and some people even developPython GUl apps directly on handset devices like the N900.LinksPySide Homepage:://.pyside.org/MeeGo Homepage:://.meego/PySide Wiki:://developer.qt.nokia/wiki/PySideTutorial homepage:://thp.io/2010/meego-python/Setting up the environmentFirst,ke sure to have MeeGo Netbook installed -either directly on yournetbook or in a virtual chine.How to do this is out of scope for thisdocument,so please refer to the MeeGo Wiki.
返回顶部