Editing Qt4 Hildon Legacy
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 1: | Line 1: | ||
- | == | + | [[Image:MaemoQtPicture.png]] |
+ | <br><br> | ||
+ | == [[Image:Intro.png]] Intro == | ||
- | + | === Maemo Platform === | |
- | + | The Maemo Platform is the software stack for Nokia Internet Tablets, which includes the Maemo operating system and the Maemo SDK. The Maemo Platform is mostly based on open source code, and has been developed by the Maemo Software department within Nokia in collaboration with many open source projects such as the Linux kernel, Debian, and GNOME.<ref>[http://en.wikipedia.org/wiki/Maemo_Platform Maemo Platform on Wikipedia]</ref> | |
- | + | [http://maemo.org/intro/platform/ Read more...] | |
- | + | === What is Hildon? === | |
- | + | Hildon is an application framework for Linux operating system mobile devices (PDAs, mobile phones, etc), developed by Nokia for Maemo and now a part of GNOME, that focuses on providing a finger friendly interface.<ref>[http://en.wikipedia.org/wiki/Hildon Hildon on Wikipedia]</ref> | |
- | To start to develop with Maemo Qt, we need to [[ | + | [http://live.gnome.org/Hildon Read more...] |
+ | |||
+ | === Developing on Maemo === | ||
+ | |||
+ | Developing applications for Maemo is done with the Maemo SDK. The process from creating the first prototype of your application to distributing to a wide audience consists basically of three steps: | ||
+ | |||
+ | * Share your application project in the [http://garage.maemo.org Garage]. | ||
+ | * Make your application easy to install and put in the [[Extras]]. | ||
+ | * Once your application has a high quality - be promoted to the [http://www.nokia.com/os2008 Nokia user site]. | ||
+ | |||
+ | [http://maemo.org/intro/developer_overview/ Read more...] | ||
+ | |||
+ | === Maemo SDK === | ||
+ | |||
+ | The Maemo SDK is based around the Debian-oriented Scratchbox Cross Compilation Toolkit, which provides a sandbox environment in which development may take place. Scratchbox uses Qemu to emulate an ARMEL processor or sbrsh to remotely execute instructions. Scratchbox-compatible rootstraps are available for both x86 and ARMEL, so the majority of development and debugging takes place on x86, with final packaging being for ARMEL.<ref>[http://en.wikipedia.org/wiki/Maemo_Platform#Maemo_SDK Maemo SDK on Wikipedia]</ref> | ||
+ | |||
+ | [http://www.youtube.com/watch?v=c8myh_iBy8k Watch the Maemo SDK in action!] | ||
+ | |||
+ | === What is Scratchbox? === | ||
+ | |||
+ | Scratchbox is a cross compilation toolkit designed to make embedded Linux application development easier. It also provides a full set of tools to integrate and cross compile an entire Linux distribution.<ref>[http://en.wikipedia.org/wiki/Scratchbox Scratchbox on Wikipedia]</ref> | ||
+ | |||
+ | [http://www.scratchbox.org/ Read more...] | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == [[Image:Rocket.png]] Getting started == | ||
+ | |||
+ | To start to develop with Maemo Qt, we need to install the Maemo SDK on a Linux machine. | ||
+ | |||
+ | === Hey, I don't have a Linux machine! === | ||
+ | That's not a big problem. You can run Maemo SDK in a virtual machine; | ||
+ | You can download Maemo SDK virtual Image (Linux Ubuntu + Diablo and Fremantle SDK) | ||
+ | from [http://tablets-dev.nokia.com/maemo-dev-env-downloads.php tablets-dev.nokia.com]. | ||
+ | You can get VMPlayer from [http://www.vmware.com/products/player/ here]. | ||
+ | |||
+ | === Installing the Maemo SDK === | ||
+ | Maemo SDK can be installaed in any Linux environment. | ||
+ | However Debian based distros (eg: Ubuntu) are recommended. | ||
+ | |||
+ | Documentation you need to install Maemo SDK is [http://maemo.org/development/sdks/ here]. | ||
=== Installing Qt packages in Scratchbox === | === Installing Qt packages in Scratchbox === | ||
- | Maemo Qt developers offers a set of Qt packages for | + | Maemo Qt developers offers a set of Qt packages for Diablo (Maemo4.1 - OS2008) |
+ | and Fremantle (Maemo5 - OS2009). | ||
- | === | + | ==== Diablo ==== |
- | + | Diablo Qt packages are into the official Extras repository. | |
- | + | In order to start to develop with those packages you need to add | |
+ | extras repository to your repository list. | ||
- | + | 1. Open /etc/apt/source.list with a text editor (eg: kate, gedit...) | |
+ | 2. Append the following line to that file: | ||
+ | deb http://repository.maemo.org/extras/ diablo free non-free | ||
+ | 3. Then update your APT cache with | ||
+ | <i>apt-get update</i> | ||
+ | 4. Install Qt packages with | ||
+ | <i>apt-get install libqt4-dev</i> | ||
- | + | ==== Fremantle ==== | |
- | + | You don't need to add any extra repository for Fremantle since Qt packages are already available into the SDK. | |
- | + | ||
- | + | Then you can install Qt with: | |
- | + | fakeroot apt-get install libqt4-gui libqt4-dev | |
- | apt-get install libqt4-dev | + | |
- | ==How to compile a Qt application in scratchbox== | + | ===How to compile a Qt application in scratchbox=== |
- | Qt applications are usually built using QMake. Project like KDE instead replaced QMake with CMake for more flexibility. | + | Qt applications are usually built using QMake. Project like KDE instead replaced |
+ | QMake with CMake for more flexibility. | ||
- | === QMake === | + | ==== QMake ==== |
[http://doc.trolltech.com/4.5/qmake-manual.html QMake] is a tool from Trolltech that helps simplify the build process for development project across different platforms | [http://doc.trolltech.com/4.5/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: | ||
- | + | 1. Generating project file [Required if there is not .pro file into the app source tree] | |
- | + | <i>qmake -project</i> | |
- | + | 2. Generating Makefile from the QMake project file: | |
+ | qmake file.pro | ||
+ | 3. make | ||
- | === CMake === | + | ==== CMake ==== |
+ | As told before it's not a standard tool but it's largely used from people and application coming from the KDE world. | ||
+ | Because of some issue with CMake, Diablo CMake packages are currently useless since CMake segfaults. This issue has been solved in Fremantle and CMake packages that comes from Fremantle SDK work nicely. | ||
- | + | - CMake projects has usually a CMakeLists.txt file instead of | |
+ | - .pro file used by QMake projects | ||
+ | - Makefile.am used by Autotools projects (standard in Unix/Linux) | ||
- | CMake | + | Using CMake to build the project is extremely easy. |
- | + | In the directory containing CMakeLists.txt, supply the following two commands, where path is the path to the source code. | |
- | + | ||
- | + | - cmake path | |
- | cmake path | + | - make |
- | make | + | |
- | Note: CMake is not installed by | + | Note: CMake is not installed by defualt in scratchbox. You can install it with |
- | + | <i>apt-get install cmake</i> | |
- | == Running a Qt application in: == | + | ===Running a Qt application in: === |
- | === Scratchbox === | + | ====A. Scratchbox==== |
- | Diablo and Fremantle Qt applications can run | + | Diablo and Fremantle Qt applications can run into the device as into scratchbox. |
First step to run a Qt application is starting the SDK UI: | First step to run a Qt application is starting the SDK UI: | ||
- | + | 1. Run Xephyr. It's able to run a [http://en.wikipedia.org/wiki/X_Window_System X Server] inside another X Server. | |
- | + | <i>Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb</i> | |
- | + | ||
- | + | 2. Set display for application that runs inside scratchbox | |
+ | <i><b>[sbox-DIABLO_<target>:~] ></b> export DISPLAY=:2</i> | ||
- | + | 3. You can now run the SDK UI. Diablo or Fremantle desktop will appear into your Xephyr window: | |
+ | <i><b>[sbox-DIABLO_<target>:~] ></b> af-sb-init.sh start</i> | ||
- | + | 4. Now you are ready to run any Maemo or Maemo Qt application with | |
- | + | <i><b>[sbox-DIABLO_<target>:~] ></b> run-standalone.sh ./qtapps</i> | |
- | + | Note: run-standalone.sh sets some variable needed by Qt to use the Hildon style. | |
- | + | ||
- | == | + | ====B. device==== |
+ | Maemo Qt applications are linux binaries. They can run into the device without any problem if you copy it/them in "partitions" mounted with exec flag. (Eg: /home/user or /opt in Fremantle). | ||
- | Porting a Qt desktop application to Maemo requires very little effort. This | + | Eg: If we want to run quassel (Qt IRC Client) we have to launch it with: |
+ | <b>Nokia-N900-44-1:/home/user#</b> ./quassel | ||
+ | |||
+ | <br><br> | ||
+ | |||
+ | == [[Image:Hammer.png]] Porting a Qt application to Maemo == | ||
+ | |||
+ | ===Intro=== | ||
+ | |||
+ | Porting a Qt desktop application to Maemo requires very little effort. This because the Maemo Qt libraries will take care of giving the Hildon look & Feel and enabling the virtual input methods for your application. | ||
===Overriding the Qt Maemo changes=== | ===Overriding the Qt Maemo changes=== | ||
Line 83: | Line 147: | ||
====Maemo Style==== | ====Maemo Style==== | ||
- | + | The Maemo style is the default style of Qt applications on Maemo. The other styles available in Qt 4.4 Maemo are [http://doc.trolltech.com/4.4/gallery-cleanlooks.html QCleanLooks], [http://doc.trolltech.com/4.4/gallery-windows.html Windows] and [http://doc.trolltech.com/4.4/gallery-plastique.html Plastique] (It will be available in the next release of Qt). | |
- | + | ||
- | + | You can force your application to use another style in several ways: | |
- | + | ||
+ | * Running your application with the flag -style <style_name> | ||
+ | <small>''HINT: You can put this flag in the Exec field of the desktop file that launch the application.''</small> | ||
- | + | $> ./qt-test-application -style windows | |
- | + | ||
- | ./qt-test-application -style windows | + | |
- | * | + | * If you want to change your code, you can use this static function:[http://doc.trolltech.com/4.4/qapplication.html#setStyle QApplication::setStyle( QStyle * style )] |
- | * If you want to change the style | + | * If you want to change the style only for a particular widget, you can call this function in the widget constructor: [http://doc.trolltech.com/4.4/qwidget.html#setStyle QWidget::setStyle( QStyle * style )] |
====Showing the status bar==== | ====Showing the status bar==== | ||
Hildon applications don't have a status bar. Qt for Maemo hides the status bar by default. | Hildon applications don't have a status bar. Qt for Maemo hides the status bar by default. | ||
+ | You can show it again by modifying your code. | ||
- | + | TODO | |
====Using the Kinetic Finger Scrolling (cf Gtk's PannableArea)==== | ====Using the Kinetic Finger Scrolling (cf Gtk's PannableArea)==== | ||
- | |||
See [[Qt/Finger Scrolling|Finger Scrolling]] | See [[Qt/Finger Scrolling|Finger Scrolling]] | ||
===Adding Maemo changes to a Qt Application=== | ===Adding Maemo changes to a Qt Application=== | ||
- | Some methods of Qt for Maemo are not available in the "standard" Qt libs, so a Qt application with specific Maemo Qt code can't be built outside the Maemo SDK. To avoid this issue, the developer can use the preprocessor directives, for example | + | Some methods of Qt for Maemo are not available in the "standard" Qt libs, so a Qt application with specific Maemo Qt code can't be built outside the Maemo SDK. To avoid this issue, the developer can use the preprocessor directives, for example: |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | #ifdef Q_WS_HILDON | |
+ | //Specific hildon code here | ||
+ | #endif | ||
===Limitations=== | ===Limitations=== | ||
Line 134: | Line 184: | ||
'''At the moment, creating a Qt application that follows Maemo 5 UI Style requires using custom Qt widgets, coded within the application itself'''. | '''At the moment, creating a Qt application that follows Maemo 5 UI Style requires using custom Qt widgets, coded within the application itself'''. | ||
- | There is work ongoing to provide Qt Hildon widgets for Maemo 5, see [ | + | There is work ongoing to provide Qt Hildon widgets for Maemo 5, see [http://wiki.maemo.org/Qt4_Hildon/Qt_Hildon_Widgets Qt Hildon Widgets] |
- | To get the benefits of the ongoing Maemo 5 hildon integration work in Qt, you must get the latest Qt source code and compile it yourself. See [ | + | To get the benefits of the ongoing Maemo 5 hildon integration work in Qt, you must get the latest Qt source code and compile it yourself. See [http://wiki.maemo.org/Qt4_Hildon#Building_Qt_from_GIT_rep Building Qt from GIT repository]. |
- | + | <br> | |
+ | <br> | ||
- | + | == [[Image:Bug.png]] Debugging a Qt application == | |
- | + | ===GDB === | |
- | + | ||
- | + | ||
- | == Profiling a Qt application == | + | ====Intro ==== |
+ | |||
+ | The GNU Project Debugger, or gdb for short, is a general purpose debugger that can be used for various debugging purposes. | ||
+ | |||
+ | ====Debugging a Qt application in Scratchbox==== | ||
+ | |||
+ | TODO | ||
+ | |||
+ | ====Debugging a Qt application on device==== | ||
+ | |||
+ | <ol> | ||
+ | <li>Installing gdb on the device.<ol> | ||
+ | <li>Add the [http://maemo.org/development/tools/ SDK tools] repository to the catalogue list.</li> | ||
+ | <li>install gdb by using apt-get (require around 6 MB of space)</li> | ||
+ | </ol></li> | ||
+ | <li>Install the debug symbols files in scratchbox (ARMEL target)</li> | ||
+ | apt-get install libqt4-dbg | ||
+ | <li>Run the application (device side)</li> | ||
+ | $gdbserver 0.0.0.0:1234 ./qtApplication | ||
+ | <li>Run the gdb client on your host PC (scratchbox side)</li> | ||
+ | [sbox-DIABLO_ARMEL: ~/TEST/svn/qt4-x11-4.4.0/examples/widgets/tablet] > gdb ./qtApplication | ||
+ | <li>Set the target of gdb</li> | ||
+ | (gdb) target remote 172.21.37.117:1234 | ||
+ | <li>Tell to gdb to continue to debug the application on the device</li> | ||
+ | (gdb) continue | ||
+ | <li>Wait some moments...</li> | ||
+ | <li>If necessary you can put break points; eg: for void QWidget::setPalette ( const QPalette & )</li> | ||
+ | (gdb) break QWidget::setPalette(QPalette const&) | ||
+ | Breakpoint 1 at 0x4026ae68 | ||
+ | |||
+ | <li>Your application will appear on the device screen. Happy debugging!</li></ol> | ||
+ | |||
+ | ===Links=== | ||
+ | |||
+ | * [http://www.gnu.org/software/gdb/documentation/ GDB documentation & tutorials] | ||
+ | * [http://maemo.org/development/documentation/man_pages/gdbserver/ GDBServer man page] | ||
+ | * [http://maemo.org/maemo_release_documentation/maemo4.1.x/node15.html Maemo debugging guide] | ||
+ | * [http://repository.maemo.org/pool/diablo/free/g/gdb/ gdb debian package for Diablo] | ||
+ | |||
+ | <br><br> | ||
+ | == [[Image:chart.png]] Profiling a Qt application == | ||
=== OProfile === | === OProfile === | ||
- | + | OProfile is a low overhead system-wide profiler for Linux. It can be used to find CPU usage bottlenecks in the whole system and within processes. It works fine in the device, but viewing the reports can take quite a long time (10 minutes) when fired up on N800/N810 devices. Therefore, it often makes sense to run opreport in scratchbox. | |
+ | |||
+ | If you want to know more about OProfile in Maemo see the [http://maemo.org/development/tools/doc/chinook/oprofile/ documentation]. | ||
=== Valgrind === | === Valgrind === | ||
- | + | TODO | |
- | + | <br><br> | |
- | + | == [[Image:chart.png]] Qt benchmarks == | |
+ | 2D graphic benchmark tools: | ||
- | + | * [[Qt/Benchmark/qgear|QGears]] | |
+ | 3D graphic benchmark tools: | ||
- | + | * TODO | |
+ | <br><br><br> | ||
- | == | + | == [[Image:package.png]] Packaging a Qt application for Maemo == |
- | + | {{main|Packaging a Qt application}} | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <br><br> | |
+ | == [[Image:Helmet.png]] Maemo Qt API Reference == | ||
- | + | 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://doc.trolltech.com/4.5/index.html Official Qt 4.5 API documentation] and the list below to see what are the Maemo changes. | ||
- | '''QInputEvents''' don't move the cursor. | + | ===Diablo=== |
- | It's mandatory to get working the HIM moving the cursor via QInputMethodEvents. | + | '''QString QDesktopServices::storageLocation(StandardLocation type)''' returns specific Maemo locations for these types: |
- | Why is it mandatory? Because if the user select text with the finger from the right to the left, we are able to remove the highlighted text, but the cursor will be moved on the last char instead to stay on the first one. | + | - DesktopLocation: QDir::homePath() + QLatin1String("/MyDocs"), instead of QDir::homePath() + QLatin1String("/Desktop") |
+ | - DocumentsLocation: QDir::homePath() + QLatin1String("/MyDocs/.documents"), instead of QDir::homePath() + QLatin1String("/MyDocs/.documents") | ||
+ | - PicturesLocation: QDir::homePath() + QLatin1String("/MyDocs/.images"), instead of QDir::homePath() + QLatin1String("/Pictures") | ||
+ | - MusicLocation: QDir::homePath() + QLatin1String("/MyDocs/.sounds"), instead of QDir::homePath() + QLatin1String("/Music") | ||
+ | - MoviesLocation: QDir::homePath() + QLatin1String("/MyDocs/.videos"), instead of QDir::homePath() + QLatin1String("/MyDocs/.videos") | ||
+ | |||
+ | '''QTabletEvents''' are able to get the pressure value from the touchscreen. | ||
+ | - The eventdeviceType is for the touchscreen is set to QTabletEvent::Stylus. | ||
+ | - QTabletEvents won't be used anymore in Fremantle | ||
+ | |||
+ | '''Finger poke''' is emulated in scratchbox by the Middle Mouse button (NOTE: There is no Fullscreen VKB in scratchbox) | ||
+ | |||
+ | '''QInputEvents''' don't move the cursor. | ||
+ | It's mandatory to get working the HIM moving the cursor via QInputMethodEvents. | ||
+ | Why is it mandatory? | ||
+ | Because if the user select text with the finger from the right to the left, we are able to remove the highlighted text, but the | ||
+ | cursor will be moved on the last char instead to stay on the first one. | ||
- | To do that some changes has been added to some widget function like: ''widget::inputMethodEvent(QInputMethodEvent *e)''. | + | To do that some changes has been added to some widget function like: ''widget::inputMethodEvent(QInputMethodEvent *e)''. |
- | Modifing that function in some custom widgets may be necessary. Don't reimplementing that function will break some fullscreen virtual keyboard features. | + | Modifing that function in some custom widgets may be necessary. |
+ | Don't reimplementing that function will break some fullscreen virtual keyboard features. | ||
- | '''Hardcoded Keys:''' | + | '''Hardcoded Keys:''' |
- | In the QMainWindow: | + | In the QMainWindow: |
- | + | - F6 - Toggle fullscreen the application | |
- | + | - F4 - Shows/Hides the application context menu | |
- | + | - Zoom in - is a standard [http://doc.trolltech.com/4.4/qkeysequence.html#StandardKey-enum key sequence] QKeySequence::ZoomIn | |
- | + | - Zoom out - is a standard [http://doc.trolltech.com/4.4/qkeysequence.html#StandardKey-enum key sequence] QKeySequence::ZoomOut | |
- | '''Input Method:''' | + | '''Input Method:''' |
- | Maemo Qt uses the Hildon IM as default Input method. Each kind of widget can set the IM mode. This allows the input method to focus on the type of input that the application is expecting. Eg: spinboxes can receive only numeric characters (1-9). | + | Maemo Qt uses the Hildon IM as default Input method. |
+ | Each kind of widget can set the IM mode. This allows the input method to focus on the type of input that the application is expecting. | ||
+ | Eg: spinboxes can receive only numeric characters (1-9). | ||
+ | |||
+ | NOTE: Qt widgets like QTextEdit, QLineEdit... set the right input method mode automatically. | ||
+ | |||
+ | A developer can change it by using: | ||
+ | void QInputContext::setInputMode(int mode); | ||
+ | It will update immediately the Hildon Input method to use the selected IM mode. | ||
+ | |||
+ | HIC Modes: | ||
+ | HILDON_GTK_INPUT_MODE_ALPHA alphabetical characters and whitespace | ||
+ | HILDON_GTK_INPUT_MODE_NUMERIC numbers 0-9 and the '-' character | ||
+ | HILDON_GTK_INPUT_MODE_SPECIAL special characters | ||
+ | HILDON_GTK_INPUT_MODE_HEXA hexadecimal characters; numbers 0-9, characters a-f, and A-F | ||
+ | HILDON_GTK_INPUT_MODE_TELE telephone numbers; numbers 0-9, whitespace, and the characters "pwPW/().-+*#?," | ||
+ | HILDON_GTK_INPUT_MODE_FULL unrestricted entry mode, combination of the alpha, numeric and special modes. | ||
+ | HILDON_GTK_INPUT_MODE_MULTILINE the client contains multiple lines of text or accepts linebreaks in the input. | ||
+ | HILDON_GTK_INPUT_MODE_INVISIBLE do not echo or save the input in the IM when entering sensitive information such as passwords. | ||
+ | HILDON_GTK_INPUT_MODE_AUTOCAP automatically capitalize the first letter at the start of a sentence. | ||
+ | HILDON_GTK_INPUT_MODE_DICTIONARY enable predictive dictionaries and learning based on the input. | ||
+ | |||
+ | Example: | ||
+ | For a password field we need to set a specific IM mode: | ||
+ | int mode = HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE | ||
+ | QInputContext qic = widget->inputContext(); | ||
+ | qic->setInputMode(mode); | ||
+ | |||
+ | If you are developing a Custom widget able to receive input text, you can instruct your widget to use the right IM Mode just returning | ||
+ | the mode. | ||
+ | |||
+ | - How does it work? | ||
+ | The Hildon IM sends a XMessage to pop up the "Virtual Keyboard" (or better the Main HIM UI) when an input widget receive the focus. | ||
+ | The IM before to raise the VKB, makes an inputMethodQuery to the widget retrieving the IM mode. | ||
+ | If the developer of the custom widget doesn't set the mode property, the IM will use HILDON_GTK_INPUT_MODE_FULL (the default mode) for that widget. | ||
+ | |||
+ | Setting the ImMode is quite easy. Check the code below for more understanding. | ||
+ | |||
+ | #ifdef Q_WS_HILDON | ||
+ | #include <QInputContext> | ||
+ | #endif | ||
+ | |||
+ | QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery query) const | ||
+ | { | ||
+ | Q_D(const QAbstractSpinBox); | ||
+ | switch(query) { | ||
+ | case Qt::ImMode:{ | ||
+ | int mode = HILDON_GTK_INPUT_MODE_NUMERIC; | ||
+ | return QVariant(mode); | ||
+ | } | ||
+ | default: | ||
+ | return d->edit->inputMethodQuery(query); | ||
+ | } | ||
+ | } | ||
- | |||
- | + | ===FREMANTLE=== | |
- | + | [TODO] | |
- | + | ||
- | + | ||
- | + | ||
- | + | Note: | |
- | * | + | Printing (QPrint*) and System tray support has been compiled out in current |
- | + | Qt 4.5.3-xxxx-maemo4 packages. | |
- | + | Since incompatibility with KDE, they have been enabled again in next Qt 4.5.3 packages. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <br><br> | |
- | + | ||
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | == [[Image:Helmet.png]] Contributing to the Maemo Qt Project == | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | Maemo Qt is a community project. Contributing to the forum, sending us patches, give us feedbacks, tracking bugs are all activities that help us to improve the quality of our work. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | Here there is a list of things that every person interested in helping us should read. | |
- | === | + | ===Be updated=== |
+ | Any Maemo Qt developer should be updated and should participate to the discussions, for that he must join the Mailing list. | ||
+ | BTW the mailing list is not for Maemo Qt Developers but it's open to Maemo Qt application developers too. | ||
- | + | === Introduction to Git === | |
- | + | If you are a git newbie you maybe find interesting these links: | |
- | + | * http://www.sourcemage.org/Git_Guide | |
- | + | * http://www.gitcasts.com/ | |
- | + | * http://www.gnome.org/~newren/eg/git-for-svn-users.html | |
- | + | * Using the git protocol through a HTTP CONNECT proxy: http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/ | |
- | + | ||
- | + | ||
- | === | + | ===Understanding the structure of our Git repository=== |
+ | These info are here:[[Qt Maemo Git Process]]. | ||
- | |||
- | |||
- | === | + | === Preparation === |
+ | Make sure each scratchbox target has | ||
- | + | fakeroot apt-get build-dep libqt4-gui | |
- | + | ||
- | + | (you may need to apt-get install libgl-dev too as it's not in the Build-Depends: yet) | |
- | + | ||
- | + | ===Building Qt from GIT rep=== | |
- | + | * Clone the repository: | |
+ | git clone git://gitorious.org/+qt-maemo-developers/qt/qt-maemo.git | ||
+ | or if you are a member of our team: | ||
+ | git clone git@gitorious.org:+qt-maemo-developers/qt/qt-maemo.git | ||
- | + | * Change dir | |
- | + | cd qt-maemo | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | * Copy the remote 4.5 branch in your workingcopy | |
+ | git checkout -b 4.5 origin/4.5 | ||
- | + | * Checkout ONE of these branches: | |
+ | git checkout -b qt-diablo origin/qt-diablo | ||
+ | git checkout -b qt-n900 origin/qt-n900 | ||
+ | git checkout -b qt-mer origin/qt-mer | ||
- | + | * Build the packages: | |
+ | dpkg-buildpackage -rfakeroot -b | ||
- | + | ===Checking out all the remote branches=== | |
+ | * Clone the repository: | ||
+ | git clone git://gitorious.org/+qt-maemo-developers/qt/qt-maemo.git | ||
+ | or if you are a member of our team: | ||
+ | git clone git@gitorious.org:+qt-maemo-developers/qt/qt-maemo.git | ||
- | + | * Change dir | |
- | + | cd qt-maemo | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | * Check out our script branch | |
- | + | git checkout -b maemo-qt-scripts origin/maemo-qt-scripts | |
- | + | ||
- | / | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | * Save a copy of the script outside the working directories | |
- | + | cp maemo-qt-scripts/copy-all-remote-branches-locally/copy.sh ../ | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | * Launch the copy.sh script | |
+ | ../copy.sh | ||
- | + | ===Commit changes in SVN [OLD]=== | |
- | + | ||
- | + | ||
- | + | If you are a Maemo Qt developer and you want to save your changes in the Garage SVN but your project is not ready to go to the main line (trunk/qt-x11), you should create a private branch and then work there until the merging with the mainline. | |
- | + | For that you have to create a your directory in branches/ named ''developer_name-qt''. After that you can copy trunk/qt-x11 in your directory. | |
+ | svn copy --username developer_name https://garage.maemo.org/svn/qt4/trunk/qt-x11 https://garage.maemo.org/svn/qt4/branches/developer_name-qt -m "Creating private branch of trunk/qt-x11" | ||
- | + | NOTE: Subversion uses cheap copy, so them don't increase the size of the repository. Then feel free to create your own branch. | |
- | + | ===Merging branches changes in the mainline [OLD]=== | |
- | + | Before to merge your changes in the mainline, the code must be full working, cleaned and tested. A review from another developer is also needed in order to reduce the possibility to add errors. | |
- | < | + | <br><br> |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | == | + | ==[[Image:Help-contents.png]] F.A.Q.== |
- | + | === I'm trying to compile a Qt application for ARMEL, but I got the error below. What's wrong? === | |
- | + | /targets/FREMANTLE_X86/usr/include/qt4/QtCore/qatomic_i386.h:127: error: impossible constraint in 'asm' | |
- | + | You are using x86 include files, then you have to update your Makefile. Running <code>qmake</code> before <code>make</code> will be solve this issue. | |
- | + | === I'm trying to compile a Qt packcage for x86, but I got the error below. What's wrong? === | |
- | + | In file included from maemo/gconfsymbols.cpp:41: | |
+ | maemo/gconfsymbols_p.h:49:25: gconf/gconf.h: No such file or directory | ||
- | + | Your scratchbox does not have <code>/bin/sh</code>, so when calling <code>pkg-config</code> from <code>qmake</code>, <code>CFLAGS</code> and <code>LIBS</code> are not set correctly. Running <code>ln -s /scratchbox/tools/bin/sh /bin/sh</code> will be solve this issue. | |
- | === | + | === I'm trying to compile a diablo Qt package, so I just created a symbolic link, debian, for debian.diablo, and then run dpkg-buildpackage command, but I got a build error because the symbolic link was deleted. === |
- | + | When running dpkg-buildpackage, all symbolic links will be deleted, so need to rename the folder from debian.diablo to debian to make a build of diablo Qt package. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | === | + | === I installed Qt (libqt4-dev) to scratchbox and tried to build a sample application, but I got the error because some header files such as qhildonstyle.h, and qvfbhdr.h etc. were missing. === |
- | + | libqt4-dev should copy all header files, but now, at least in 4.5.2-1maemo1, some files are missing. Please download file below and extract to your scratchbox system. | |
- | + | http://qt4.garage.maemo.org/patches/qt4-missing-header.tgz | |
- | + | ===Installing Qt on N900=== | |
+ | If you have already a fremantle device then you can install new Qt packages from extras-devel. | ||
+ | The step to follow are: | ||
+ | * Free space | ||
+ | * echo "deb http://repository.maemo.org/extras-devel/ fremantle free non-free | ||
+ | " >> /etc/apt/sources.list.d/hildon-application-manager.list | ||
+ | * apt-get install libqt4-gui | ||
+ | The basic packages will be so installed. | ||
- | + | Current known issues: | |
+ | * libqt4-opengl depends by libgles2, but it is not installable anymore.Has it been replaced with libgles2-sgx-img? | ||
- | + | ===Where are the Hildon Widgets for Qt=== | |
+ | Short answer : they've not been written.... yet. | ||
- | + | Qt allows you to create your own widgets very easily. However, in order to provide as consistent an appearance as possible for the Maemo platform the community will be creating a set of [[/Qt Hildon Widgets|Qt Hildon Widgets]] | |
- | + | ===Is it yet possible to create Fremantle desktop widgets using Qt?=== | |
- | + | Since desktop applet are libraries (.so files) then it's not so simple making Qt desktop applet. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | === | + | |
- | + | ||
- | + | ||
- | + | At moment I didn't investigate for a solution.. but it's possible (I tried it) to put Qt Widgets into the desktop just changing the Window Type of the widget (eg a QDialog) with the right Window Type. | |
- | + | ||
- | + | Then a Qt application can put widgets in the hildon-desktop but the "applet manager" that loads the desktop widgets doesn't recognize them as applet, then it doesn't manage Qt home applets. | |
- | |||
- | |||
- | |||
- | + | == How to minimize a Qt application? == | |
- | : | + | QDBusConnection c = QDBusConnection::sessionBus(); |
- | + | QDBusMessage m = QDBusMessage::createSignal("/","com.nokia.hildon_desktop","exit_app_view"); | |
- | + | c.send(m); | |
- | + | == References == | |
- | + | ||
- | + | <references/> | |
- | + | ||
- | + | ||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:Qt]] | [[Category:Qt]] |
Learn more about Contributing to the wiki.