Qt4 Hildon Legacy
(→API changes) |
(→API changes) |
||
Line 89: | Line 89: | ||
[http://doc.trolltech.com/4.4/index.html Official Qt 4.4 API Documentation] and check the list below to know what are the API changes and additional info. | [http://doc.trolltech.com/4.4/index.html Official Qt 4.4 API Documentation] and check the list below to know what are the API changes and additional info. | ||
- | This is the list of the API changes. | + | This is the list of the API changes. |
- | + | ||
+ | The application can sets the proper double click radius. The default value is 20px. (TO TEST) | ||
+ | static void QApplication::setDoubleClickRadius(int); | ||
+ | static int QApplication::doubleClickRadius(); | ||
Other useful info about the API are: | Other useful info about the API are: |
Revision as of 17:01, 2 December 2008
Contents |
Intro
What is Maemo?
Few words about the maemo software platform
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
Developing in Maemo
Maemo SDK
If you want to get more info about the Maemo SDK or simply you want to install it on your linux box this is the page that you want to check: SDK Releases
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.
Installing the Maemo SDK (Scratchbox)
If you want to install the maemo SDK on your linux box this is the page that you want to check: SDK Releases
Porting a Qt application in Maemo
Intro
Basically porting a Qt application in Maemo means building your application for ARMEL. The Maemo Qt libraries will take care to give the Hildon Maemo look & Feel and to enable the hildon input method for your application.
How to compile a Qt application in scratchbox
All the Qt tools that you need are available in scratchbox. So in order to compile a Qt application you need to follow the standard Qt way:
qmake -project qmake file.pro make
Overriding the Qt maemo changes
Maemo Style
The Maemo style is the default style of the Qt applications that run in Maemo. The other styles available in Qt 4.4 maemo are QCleanLooks, Windows and Plastique (It will be available in the next packages of Qt).
You can force your application to use another style in several way:
1. Running your application with the flag -style <style_name>
$> ./qt-test-application -style windows
HINT: You can put this flag in the Exec field of the desktop file that launch the application.
2. If you want to change your code, you can use this static function:QApplication::setStyle( QStyle * style )
3. If you want to change the style only for a particular widget, you can call this function in the widget constructor: QWidget::setStyle( QStyle * style )
Showing the status bar
The hildon applications don't have a stuatus bar. Qt for maemo hide the status bar by default. You can show it again modifying your code. TODO
Limitations
TODO
Debugging a Qt application
GDB
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 into scratchbox
TODO
Debugging a Qt application into the device
TODO
Links
Packaging a Qt application for Maemo
API changes
We don't want to break the API compatibility at all, but sometime we need to add some functions then to develop a Qt application in Maemo you can use the Official Qt 4.4 API Documentation and check the list below to know what are the API changes and additional info.
This is the list of the API changes.
The application can sets the proper double click radius. The default value is 20px. (TO TEST) static void QApplication::setDoubleClickRadius(int); static int QApplication::doubleClickRadius();
Other useful info about the API are:
QTableEvents are able to get the touchscreen info (Eg: pressure). - Touchscreen eventdeviceType is QTabletEvent::Stylus.
Finger poke is emulated in scratchbox by the Middle Mouse button (NOTE: It looks like that there is no Fullscreen VKB in scratchbox)
QInputEvents don't move the cursor. In Hildon we need that these events will move the text cursor. This because we have to remove the highlighted text, before to show the fullscreen virtual keyboard. What's happen if the user select text with the finger from the right to the left? In this case we are able to remove the highlighted text, but the cursor will be moved on the last char instead to remain before the first char. To do that some changes has been added to the some widget::inputMethodEvent(QInputMethodEvent *e) functions. NOTE: Some custom widgets maybe need to add some code, in order to move the cursor, to work properly with the fullscreen VKB.