Editing Qt4 development
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 12: | Line 12: | ||
To start to develop with Maemo Qt, we need to [[Documentation/Maemo_5_Final_SDK_Installation|install the Maemo SDK]]. | To start to develop with Maemo Qt, we need to [[Documentation/Maemo_5_Final_SDK_Installation|install the Maemo SDK]]. | ||
- | Qt is available in public Fremantle repository since the release of [[Maemo 5/PR1.2|PR1.2]]. To upgrade older Scratchbox targets to use the latest packages, execute the following commands (inside Scratchbox): | + | Qt 4.6 is available in public Fremantle repository since the release of [[Maemo 5/PR1.2|PR1.2]]. To upgrade older Scratchbox targets to use the latest packages, execute the following commands (inside Scratchbox): |
fakeroot apt-get update | fakeroot apt-get update | ||
fakeroot apt-get dist-upgrade | fakeroot apt-get dist-upgrade | ||
Line 19: | Line 19: | ||
fakeroot apt-get install libqt4-dev | fakeroot apt-get install libqt4-dev | ||
- | '''GIANT WARNING''': Your device might not be running Qt 4.6, but your Scratchbox probably is. Make sure that your N900 has | + | '''GIANT WARNING''': Your device might not be running Qt 4.6, but your Scratchbox probably is. Make sure that your N900 has the PR1.2 update by checking the software version (found in Settings->About product. PR1.2 is version 10.2010.19-1. |
===How to compile a Qt application in Scratchbox=== | ===How to compile a Qt application in Scratchbox=== | ||
- | Qt applications are usually built using QMake. | + | Qt applications are usually built using QMake. Project like KDE instead replaced QMake with CMake for more flexibility. |
==== QMake ==== | ==== QMake ==== | ||
- | [http://doc.trolltech.com/qt-maemo-4.6/qmake-manual.html QMake] is a tool that helps simplify the build process for development project across different platforms | + | [http://doc.trolltech.com/qt-maemo-4.6/qmake-manual.html QMake] is a tool from Trolltech that helps simplify the build process for development project across different platforms |
You can build your Maemo Qt application in 3 simple steps: | You can build your Maemo Qt application in 3 simple steps: | ||
Line 52: | Line 52: | ||
First step to run a Qt application is starting the SDK UI: | First step to run a Qt application is starting the SDK UI: | ||
- | # Run Xephyr | + | # Run Xephyr. It is able to run a [[:wikipedia:X_Window_System|X Server]] inside another X Server.<pre>Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb</pre> |
- | # | + | # Set display for application that runs inside Scratchbox:<pre>export DISPLAY=:2</pre> |
# You can now run the SDK UI. A Diablo or Fremantle desktop will appear in your Xephyr window:<pre>af-sb-init.sh start</pre> | # You can now run the SDK UI. A Diablo or Fremantle desktop will appear in your Xephyr window:<pre>af-sb-init.sh start</pre> | ||
# Now you are ready to run any Maemo or Maemo Qt application with:<pre>run-standalone.sh ./qtapps</pre> | # Now you are ready to run any Maemo or Maemo Qt application with:<pre>run-standalone.sh ./qtapps</pre> | ||
Note: <code>run-standalone.sh</code> sets some variable needed by Qt to use the Hildon style. | Note: <code>run-standalone.sh</code> sets some variable needed by Qt to use the Hildon style. | ||
- | |||
- | |||
==== Device ==== | ==== Device ==== | ||
Maemo Qt applications are Linux binaries. They can run on the device without any problem if you copy them to "partitions" mounted with exec flag. (for example, <code>/home/user</code> or <code>/opt</code> in Fremantle). | Maemo Qt applications are Linux binaries. They can run on the device without any problem if you copy them to "partitions" mounted with exec flag. (for example, <code>/home/user</code> or <code>/opt</code> in Fremantle). | ||
- | + | Fore example, if we want to run quassel (Qt IRC Client) we have to launch it with: | |
su -c ./quassel user | su -c ./quassel user | ||
Line 146: | Line 144: | ||
Maemo Qt is based on Qt for X11. It shares same APIs avoiding API breaks. In this way every Qt application that runs in other platforms (Windows, Mac OS X, Linux, S60, etc.) can run in Maemo devices as well. To Develop a Qt application you can use the [http://qt.nokia.com/doc/qt-maemo-4.6 Official Qt 4.6 for Maemo API documentation] and the list below to see what are the Maemo changes. | Maemo Qt is based on Qt for X11. It shares same APIs avoiding API breaks. In this way every Qt application that runs in other platforms (Windows, Mac OS X, Linux, S60, etc.) can run in Maemo devices as well. To Develop a Qt application you can use the [http://qt.nokia.com/doc/qt-maemo-4.6 Official Qt 4.6 for Maemo API documentation] and the list below to see what are the Maemo changes. | ||
- | Here are examples that show several Maemo 5 Qt widgets in Qt. | + | Here are examples that show several Maemo 5 Qt widgets in Qt 4.6. |
* http://qt.nokia.com/doc/qt-maemo-4.6/examples-maemo5.html | * http://qt.nokia.com/doc/qt-maemo-4.6/examples-maemo5.html | ||
Line 153: | Line 151: | ||
===Maemo5 Readme file=== | ===Maemo5 Readme file=== | ||
- | There is a [http://qt.gitorious.org/+qt-developers/qt/x11-maemo/blobs/4.6-fremantle/README.maemo5 README file in Qt source tree]. | + | There is a [http://qt.gitorious.org/+qt-developers/qt/x11-maemo/blobs/4.6-fremantle/README.maemo5 README file in Qt 4.6 source tree]. |
== Contributing to the Maemo Qt Project == | == Contributing to the Maemo Qt Project == | ||
Line 187: | Line 185: | ||
===Building Qt from Git repository=== | ===Building Qt from Git repository=== | ||
- | |||
# Clone the repository:<br/><pre>git clone git://gitorious.org/+qt-developers/qt/x11-maemo.git qt-maemo</pre><br/> | # Clone the repository:<br/><pre>git clone git://gitorious.org/+qt-developers/qt/x11-maemo.git qt-maemo</pre><br/> | ||
# Change dir:<br/><pre>cd qt-maemo</pre> | # Change dir:<br/><pre>cd qt-maemo</pre> | ||
- | # Configure Qt:<br/> | + | # Configure Qt:<br/><pre>./configure -maemo5</pre> |
# Build Qt:<br/><pre>make</pre> | # Build Qt:<br/><pre>make</pre> | ||
# Install Qt:<br/><pre>make install</pre> | # Install Qt:<br/><pre>make install</pre> |
Learn more about Contributing to the wiki.