Get the source code
This section describes how to set up your local development environment, how to use git to get Qt’s source code, and how to build the libraries on your machine.
Setting up your machine
Qt can be built and developed on many different platforms. The operating systems for development are Mac OS X, Windows and Linux, with different requirements on compilers and third-party libraries. Developing Qt requires building it from source, therefore the standard requirements apply:
- Qt for Embedded Linux Requirements
- Qt for Mac OS X Requirements
- Qt for Windows CE Requirements
- Qt for Windows Requirements
- Qt for X11 Requirements
In addition you need to have Perl installed. This is standard on most Linux distributions and Mac OS X. Windows users can download ActivePerl for free.
Qt’s source code is developed using Git, an open source, distributed version control system. You need to have Git >= 1.6.x installed.
For more information please see the separate GitInstallation wiki page.
Cloning Qt
After setting up your machine by installing the required tools and libraries for building Qt download the source code by cloning the Qt git repository, using the following commands:
-
git clone git://gitorious.org/qt/qt.git
-
cd qt
Behind a Company Firewall
If the clone process fails with “unable to connect to socket” it’s likely that you are behind a firewall that blocks the Git protocol.
First try replacing the clone URL with its HTTP equivalent, http://git.gitorious.org/qt/qt.git
If that does not help, an alternate solution is to clone using the SSH protocol proxied though a HTTP proxy. This will also work for pushing changes.
First install Corkscrew on your machine.
Next, edit your SSH config and add:
Host *gitorious.org
Hostname ssh.gitorious.org
Port 443
ProxyCommand corkscrew yourproxyhost yourproxyport %h %p
Replacing yourproxyhost and yourproxyport with the hostname and port of your company’s HTTP proxy.
You should now be able to clone and push using the URL git@gitorious.org:qt/qt.git
Building Qt
Build Qt the same way you would for an official Qt release. The standard build/installation instructions apply:
- Installing Qt for Embedded Linux
- Installing Qt on Mac OS X
- Installing Qt on Windows
- Installing Qt on Windows CE
- Installing Qt on X11 Platforms
Make sure that you have Perl installed and that it is working. If configure complains about not being able to find headers. It means that syncqt, a program run by configure could not find your Perl installation.
Generate the Documentation
Since the repository is just the source code rather than a complete package the HTML documentation pages are not include. If you use a repository for a previously released Qt version, then you can go to the online documentation or download a package.
For documentation that is not yet available online or through a package you have to generate the documentation yourself. To do that, run
make docs
after running configure and building the libraries else.
What’s Next?
To learn how to make changes to Qt and upload them for submission upstream see QtContributionGuidelines. If you would like to simply stay up-to-date with your sources and silently follow the development of Qt simply run git pull in your source code directory to pull in the latest changes.

