Category Archives: 技术

How to embed an Info.plist into arbitrary binaries

For an application on OS X, the Info.plist file is very common. But could we embed it into the binaries?

Yes, we can. There is a compiler option “–sectcreate __TEXT __info_plist Info.plist”.

One example is the .pro file for qmlplugindump in qtdeclrative, change 4d173d5f16c103f640d4089feed44a74b14e9004.

I learned it from ariya‘s commit in phantomjs: 71425850f61ad85e33741ed5a59364327532f6a8.

And today I read an article: Gimmedebugah: how to embedded a Info.plist into arbitrary binaries, which also mentioned this. And it gives me the Apple documentation for that, Code Signing Tasks: Adding an Info.plist to Single-File Tools.

Memo: Mac OS X Internals

Recently just started to read a few pages in this book, Mac OS X Internals: A Systems Approach, by Amit Singh. It’s a bit old, too much contents about the old PPC.

Then yesterday found an interesting video about same topic, YouTube: Inside the Mac OS X Kernel [24c3]. (Note: some people can’t access it.) This video was public recently, but it’s also a bit old, Dec. 2007. It’s from 24th Chaos Communication Congress: Inside the Mac OS X Kernel, by lucy. (You can find the slides there.)

请点击查看视频

And I am not sure whether one sentence in the presentation is still correct or not now, “The Mac OS X kernel is not 64 bit.”

Nokia is still working on some Qt projects

Yes, Digia accquired Qt from Nokia last year. But it’s very interesting to see Nokia is still working on some Qt projects.

How do I know it?

Go to Nokia: See the latest career opportunities. Input “qt” in “Keywords” field, and select “Research & Development” in “Job Category” field, click “Search for Jobs” button. At least I got 9 positions, one in US and 8 in Berlin, Germany. It looks like the projects are about Automotive and using Qt and QML.

一些中文学习资料总结

iOS应用程序

汉字描红

我现在一般用“自定义”:“大”,每字6行,每行5次描红,打印笔顺,正好一页一字。

备注

  • 2013年2月20日:上述写字贴中的“力”的笔顺有误,汇报给网站,2月21日已经修复。
  • 2013年9月18日:上述写字贴中的“那”的笔顺无法生成,汇报给网站,9月23日已经修复。

教材

书法

参考

问题

备注: 以后会保持更新,大家如果有其它内容推荐,请回复,谢谢。

How to debug into Qt library in Qt Creator with CDB

OS: Windows 7 64bit SP1 (Note: need to have .Net 4 installed)

SDK: Windows SDK 7.1 x86_64 (Note: remember to have “Visual C++ Compilers” and “Debugging Tools for Windows” installed)

Qt Creator: Qt Creator 2.6.2 in qt-windows-opensource-5.0.1-msvc2010_32-x86-offline-2013-01-30-426.exe (Note: I am testing 5.0.1 daily build packages, 5.0.0 release doesn’t ship with .pdb files)

Qt Creator 2.6.2 could detect the compiler and cdb correctly from above environments after installed. What you need to do are only two things:

  1. Tools->Options->Debugger->CDB, In the Symbol paths field, open the Insert menu and select Symbol Server, just use default value and click OK
  2. Tools->Options->Debugger->General, in Source Paths Mapping part, click Add, set Source path field to q:\qt5_workdir\w\s and Target path field to C:\Qt\Qt5.0.1\5.0.1\Src

Then you can debug into Qt library in your applications.

Reference:

Update:

Some information about CI and build, release in qt-project

Just some information, not details:

Last night, I was back to 1998

Hi, friend, it’s a “title party” blog. The original word is 标题党, and “title party” was translated from Google Translate. I really don’t think 标题党 is “forum spammer” here.

Back to my blog, it’s about running Caesar III on my MacBook Air 2012 13″ via CrossOver.

Caesar III is one of my faviourite games during university. (Sorry, I used a crached version at that time. And it’s still in one of my hard disks, just haven’t played it for years.)

I tried Caesar IV several years ago, but I don’t like the 3D in that game.

Caesar III only has windows version.

Last week, I got a deal, CodeWeavers: Flock The Vote: 2012, a free CrossOver for Mac and Linux.

First application which I want to run, Caesar III, popped up in my mind. Googled “CrossOver Caesar III” and got this page WHAT RUNS: Caesar III, looks like it’s possbile. Then I found some people is using GOG version.

What’s GOG? Good Old Games

It’s only $5.99 and digital downloadable version! I bought it.

But I can’t run it successfully at the first time. The display is garbled after running it. But sound is ok, and ESC could trigger the Quit dialog, the dialog works.

I gave up at that night. And posted a thread in forum.

After checking my thread for days, didn’t get any reply.

Last night, got some spare time after my daughter went to sleep. I found an irc channel for CrossOver, irc.freenode.net/#crossover .

Haha, got some suggestions from Axylus.

Remove the current installed CrossOver and Caesar III:

Then install CrossOver, and Caesar III(use Windows98 bottle).

Before running the game, Configure->Manage Bottles, select “setup_caesar_3.exe” in left, and choose “Control Panel” in right, choose “Wine Configuration”, and click “Launch Selected Item”. In “Graphics” tab, check “Emulate a virtual desktop”, Desktop size could be 800×600 and 1024×768, but for 1024×768, you should also enter the game to set it in Options->Display Settings.

It works this time! (though it’s not in full-screen mode.)

I was back to 1998!

Some other tips for CrossOver:

Clues of Qt on Android and iOS

Just for who are interested in the status of Qt on Android and iOS, and want to contribute to it.

Qt on Android

Mainstream: Qt 4.8 and QtBase(Qt 5.0)

Run the following command in 4.8 branch of Qt repo and master branch in QtBase repo:

Folk: Necessitas

There is a folk, Necessitas, which is based on Qt 4.x.

Note: At least by now, it is not merged into mainline.

If you want to contribute to it, please read KDE Necessitas project: Get involved. You can find bug reports, todo list, mailing list and irc channel.

The most important one is code repository.

Qt on iOS

Mainstream 1: Qt 4.8 and QtBase(Qt 5.0)

Run the following command in 4.8 branch of Qt repo and master branch in QtBase repo:

Mainstream 2: iOS branch in QtBase(Qt 5.0)

Here is the commit history of ios branch.

Note:

How to find the changes which people are working on? Search this in codereview:

Reference: gerrit doc: Searching Changes

Update:
2012-11-08 Digia: Necessitas Android Port Contributed to the Qt Project

To be updated in future.

如何为Qt做贡献

项目不只是Qt了,应该算是Qt家族吧,例如Qt Creator等。

任务也不只是写代码了,界面、文档的汉化等等,本文都有涉及。

Qt已经Open Governance了,所有上述工作都可以走这个路径,也就是直接贡献给上游。泛泛的介绍可以看Contribute to Qt,具体的步骤:

  • 帐号:注册Jira帐号,这个帐号会被同步到codereview
  • 协议:登陆上面提到的codereview站点,点击右上角的Settings,再点击左栏下方的Agreements,点击New Contributor Agreement,一般个人都是接着选择Individual,具体协议内容在这里就不再赘述了。在文本输入框中输入I AGREE后,点击Submit Agreement。
  • SSH公钥:还是codereview站点,点击右上角的Settings,再点击左栏中部的SSH Public Keys,上传你的SSH公钥,玩过github之类网站的应该都清楚。
  • Gerrit/Git的使用方式:详见Setting Up Gerrit。其中比较重要的一步就是commit-msg,配置正确的话,在git commit之后,commit msg里就会出现Change-Id字段。另外强烈建议在最后git push之前找现有的Approver或者Maintainer帮你查看一下。
  • 上述变更在git push之后会进入codereview,然后就是和Approver或者Maintainer进行交互,直到最后完成,通常的沟通方式就是IRC或者邮件列表

Qt的界面文件翻译,一般就是.ts文件的翻译,相关过程可以参考Translating Qt Into Other Languages,需要注意的是提交的时候有特别操作:

  • 方法一:不运行git commit, 在翻译文件所在目录,运行make commit-ts
  • 方法二:运行lconvert -locations none -i yours.ts -o yours.ts,然后git commit

主要是要把.ts文件中的易变的location信息去掉。

Qt的文档翻译,鉴于现在的qdoc功能有限,对于那些类的说明(文档都放在了源代码中),目前还无法处理。但对于综述性的单独.qdoc文件是可以翻译的,例如Qt 4源码仓库中的doc/src/目录是英文文档,翻译好的简体中文文档都应该放在doc/src/zh_CN/下,请保持相同的子目录结构。Translating Qt Into Other Languages中的Translating Qt Documentation Into Other Languages一节介绍了如何从.qdoc文件生成.html文件。

Qt Project的wiki翻译,请大家把简体中文的翻译直接放在主站上,目前对于wiki页面名称好像没有一致的规定,例如:Building Qt 5 from Git构建来自 Git 的 Qt 5,页面名称中增加了-SimplifiedChinese,好像还有用_SimplifiedChinese的和_Chinese等情况,我这里比较推荐_SimplifiedChinese。另外不建议在wiki页面中加入译者博客链接之类的个人信息,请在自己的用户页面添加这些信息,例如这里是我在qt-project的个人页面。

如果大家对上述工作感兴趣,在实际操作中遇到问题,欢迎在qt-cn频道联系我(lqi)。

2012-10-25: 更新。WordPress的markdown格式有些问题,现在用的是Markdown on Save Improved。