Tag Archives: Qt

How to run ARM64(aarch64) Qt auto tests on x86_64

Assume you have a host(x86_64) build of qtbase, like following:

Some extra work to setup system:

Continue reading

Build Qt dev/5.15/5.12/4.8 on Ubuntu 23.10

Install Ubuntu 23.10, for me, it’s an VM via VMware Fusion 13.5.0 on MacBook Pro 2019.

Install some needed packages,

Default gcc/g++ is 13.2.0.

Add following in env:

Continue reading

Play Qt dev in Flatpak world

XDG Desktop Portal and Flatpak are more and more in used. If you are using Qt, Flatpak KDE runtime is a good place to start, install pre-built Qt binaries in Flatpak world. But it’s normally for the released versions.

If you want to play with the edge of Qt, for example, dev branch, you can try following steps:

And here is an example at io.qt.examples.dropsite.yaml

Thanks bbhtt for the help in matrix.to: Packaging KDE Apps in Flatpaks channel.

浏览器引擎历史的一点儿回顾

最近有关红芯办公浏览器的新闻比较火爆,可以参考搜狐:融资2.5亿的红芯宣称自主创新遭打脸:只是谷歌浏览器换层皮一文。知乎罗志宇关于自主研发一款浏览器内核的难度到底有多大?一问的回答中提到了KHTML、WebKit、Blink和KDE、Qt以及Trolltech公司(现在的The Qt Company公司)的一些渊源。

Continue reading

Qt 5.5.0 on OS X: fix for ‘-Winconsistent-missing-override’ warning

Qt 5.5.0 officially released on July 1st. But on OS X, for example 10.10.4+Xcode 6.4(clang-602.0.53), you will have lots of warnings about ‘-Winconsistent-missing-override’, like:

Yes, there is a bug report(QTBUG-46833) for it. And the fix is in 7d5e849e.

The solution is:

Go to Line 158, change 6020049 to 7000053. Save it!

The snapshot of Qt5 env at the time a commit was merged by CI

For example, I am reading Gunnar Sletta’s blog, New Scene Graph Renderer.

I guess the change is b480fa83, it’s already merged in stable(5.2.x). After talked with Gunnar, he mentioned that the result in lastest stable is perhaps very different with the blog, because there was another big change, v4, also already in stable.

I think I need to have the environment to reproduce the “scene” at that commit, b480fa83.

First, I had a look at the status of that change.

In the dependencies part, I found:

qtdeclarative depends on qtbase and qtxmlpatterns repo. For this example, just in case, we have an explicit sha1 in qtbase. It’s uncommon. Normally it’s just like the case for qtxmlpatterns, an empty string.

Next, the change in codereview.qt-project.org is this.

I found the latest information when that change was integrated, QtDeclarative_dev_Integration #719: SUCCESS.

In Qt CI results, the results for QtDeclarative_dev_Integration #719, I chose macx-clang_developer-build_OSX_10.8, then I am in this page.

Searching qtbase, you could find some information like:

I think I know what I should do for qtbase and qtxmlpatterns.

Now I could have a shadow build and play with it.

How to setup a mirror of Qt Project

There is a work from Oswald Buddenhagen, his change, qtrepotools: add mirror script.

Mirror Script

You need to have an account of codereview(gerrit) and set up the ssh keys well, more info in Contribute to Qt.

Here is the qt-codereview-mirror shell script in github.

I set up this mirror script on a Ubuntu 13.04 machine. You need to check following before to run it:

  • Install git and procmail package for git and lockfile:

  • Make sure you have /data/repos directory.

You could have a try run for the above script. If it works well for you, you can add it into your crontab, see also Ubuntu: CronHowto.

Git Daemon

Next is to run a git server on your machine. I use git-daemon for this task.

How to use your mirror?

  • For Qt 4:

If you need to push change to upstream, then you should set up gerrit remote.

  • For Qt 5:

init-repository will help you set up gerrit remote for each repo.

Distributed Compilation the build of Qt

Qt is a huge project, especially like the module, QtWebKit. If you happen to be in a computer farm, it is very useful to use distributed complation to speed up the build of Qt.

Here I suggest to use icecream on Linux and Mac OS X, and IncrediBuild on Windows(at least for Microsoft’s Visual Studio compilers). About IncrediBuild, more details perhaps will be updated in the future. See also qtrepotools: publish ibmake.bat, incredibuild xge wrapper for make/buildconsole.

Today, this blog is more about icecc/icecream.

Preparation

Linux

icecream is maintained by the SUSE people. Then there are less issues in OpenSUSE than in Ubuntu. But Ubuntu is more popular one. I just use Ubuntu as example here.

  • Install your compiler, like gcc and clang.
  • Install icecc and icemon(optional). icemon is the monitor of icecream build, better to check it when you setup the enviroments. It’s an GUI application based on Qt 4.8. Note: you need to install 0.9.8~git2012121601-0ubuntu2 and later version for icecc. More details in “icecc” package in Ubuntu.

  • For clang users, if you want to make icecream compiler package, better to do:
    • 13.04: $ sudo ln -s /usr/include/clang/3.2/include /usr/lib/clang/3.2/
    • 12.04: $ sudo ln -s /usr/include/clang /usr/lib/
  • Create compiler package: please do it. Here is the example for 13.04:

  • Enviroment settings before build:

  • Run icecc-scheduler in one of your Ubuntus:
    • Edit /etc/default/icecc, set START_ICECC_SCHEDULER="true".
  • Start icecc service: sudo /etc/init.d/icecc start, icecc-scheduler service also could be started with this. Not suggest to run multiple icecc-scheduler in same network with default values, you could edit /etc/icecc/icecc.conf with more options.
  • Stop icecc service(optional): sudo /etc/init.d/icecc stop

Mac OS X

  • Create a ‘qt’ user. Open System Preferences -> Users & Groups -> “+” under the list of users (you might need to click the lock icon first and type in your password), add a user “qt” with your standard password.
  • Install HomeBrew

  • Install XCode and command line tools.
  • Install icecc and icemon(optional).
  • Create compiler package: please do it. Here is the example for 10.8:

  • Enviroment settings before build: (Note: looks like it doesn’t work well with a compiler package. 2013-06-19)

  • Copy com.github.iceccd.plist into into /Library/LaunchDaemons .
  • sudo chown root /Library/LaunchDaemons/com.github.iceccd.plist
  • Start icecc service: sudo launchctl load /Library/LaunchDaemons/com.github.iceccd.plist
  • Stop icecc service(optional): sudo launchctl unload /Library/LaunchDaemons/com.github.iceccd.plist

Building Qt

Normally just do source ~/.icecc_rc, configure and make.

  • For clang build(both Linux and Mac OS X), please keep in mind to use -no-pch when configure.
  • For Qt4 build, the -arch argument that Qt 4 passes to the compiler confuses icecream. So for now, if you use Qt4, you need to patch your mkspec to not add that (if you build for your local architecture only), eg. in mkspecs/common/gcc-base-macx.conf.(Note: looks like it’s only on Mac OS X, I haven’t tried it yet.)

Known Issues

  • Using icecream currently screws up debug information for all object files that we compiled remotely!(Mac OS X only)

Thanks

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.

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.