Mobile Application
Development
with Qt for Symbian
Visit:

bit.ly/qtsymbian
               ...get Qt for your phone




   Qt for Symbian:  bit.ly/qtsymbian
About Me


Jason Barron




   Started              Began in                   Switched to
  July, 2005            Support...
About Me


Alessandro Portale




  09/02 – 01/07        02/07 – 03/08                     04/08 – today
Color management ...
Goal


• Why use Qt for Symbian?

• Learn what you need to get started.

• Learn how to make great apps on Symbian.




  ...
Agenda


• Getting Started

• Application Development

• UI Types

• New “Mobile-esque” Features in 4.6

• Advanced integr...
Why use Qt for Symbian?



1. Symbian is a relevant mobile platform.

2. Qt is an easy way to access Symbian.

    3. Many...
The Symbian Landscape

                                  Today



S60 3.1, 3.2          S60 5.0




                      ...
The Developer’s Shopping List


              SDK

              IDE

              Open C plugin (POSIX)

              Q...
Free      Available From          Binaries         Can be used to compile



                                             ...
Agenda


• Getting Started

• Application Development

• UI types

• New “Mobile-esque” Features in 4.6

• Advanced integr...
Demo




Qt for Symbian:  bit.ly/qtsymbian
Application Development – From Scratch


•   Carbide's Qt project wizard
•   Editing the Ui Form
•   show(), showMaximized...
Demonstration




Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt project wizard




     Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Editing the Ui Form




  Qt for Symbian:  bit.ly/qtsymbian
Adjusting the show() call




    Qt for Symbian:  bit.ly/qtsymbian
Adjusting the show() call




    Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Building and deploying for the device




          Qt for Symbian:  bit.ly/qtsymbian
Command Line


C:qt...analogclock> qmake

C:qt...analogclock> make debug-winscw
C:qt...analogclock> make release-gcce
C:qt...
Port an existing application


•   Original application on the Desktop

•   Carbide's Qt .pro file import
•   Running the ...
Carbide's Qt .pro file import




      Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt .pro file import




      Qt for Symbian:  bit.ly/qtsymbian
Carbide's Qt .pro file import




      Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Running the application in the emulator




           Qt for Symbian:  bit.ly/qtsymbian
Desktop Ui vs. Mobile Ui




                                        Successful port?


    Qt for Symbian:  bit.ly/qtsymb...
Desktop Ui vs. Mobile Ui




                                        Mobile friendly Ui


    Qt for Symbian:  bit.ly/qtsy...
Desktop Ui vs. Mobile Ui




   Including different Ui headers




    Qt for Symbian:  bit.ly/qtsymbian
Desktop Ui vs. Mobile Ui




Instantiating and showing different Uis



      Qt for Symbian:  bit.ly/qtsymbian
Desktop Ui vs. Mobile Ui




 AppController knows the view as QObject
 that emits colorChanged()

      Qt for Symbian:  b...
Desktop Ui vs. Mobile Ui




 Both Uis emit a colorChanged() signal



      Qt for Symbian:  bit.ly/qtsymbian
Agenda


• Getting Started

• Application Development

• UI Types

• New “Mobile-esque” Features in 4.6

• Advanced integr...
UI Types




Qt for Symbian:  bit.ly/qtsymbian
Agenda

• Getting Started

• Application Development

• UI Types

• New “Mobile-esque” Features in 4.6

• Advanced integra...
qmake Keywords


• MMP_RULES                           • DEPLOYMENT
• BLD_INF_RULES                       • ICON

• TARGET...
Input Method Hints




… QWidget::inputMethodHints() const;

void QWidget::setInputMethodHints(…);



                 Qt ...
Input Method Hints


• Change Behavior:                  • Restrict Input:
  –   Qt::ImhHiddenText                   –   Q...
Soft keys

QAction::setSoftKeyRole(…);
…QAction::softKeyRole() const;


enum SoftKeyRole {
QAction::NoSoftKey, //(default)...
Navigation Modes

void QApplication::setNavigationMode(...);
... QApplication::navigationMode();

enum NavigationMode {
  ...
Exceptions

    What happens if ‘new’ on line 4 throws std::bad_alloc?

MyWidget::MyWidget(QWidget *parent) : QDialog(pare...
QScopedPointer

  Deletes it’s object when the scope terminates.
class MyWidget: public QDialog
{
    Q_OBJECT

public:
  ...
Agenda


• Getting Started

• Application Development

• UI Types

• New “Mobile-esque” Features in 4.6

• Advanced integr...
Event Dispatcher – Active Scheduler


• Active objects can be used as normal


                 ActiveScheduler



       ...
Handling Symbian Leaves


• QT_TRAP_THROWING
  – Converts leaves to exceptions
• QT_TRYCATCH_ERROR
  – Converts exceptions...
RWindow, CCoeControl and QWidget


• QWidget::winId() – Returns a CCoeControl

• Always window owning:

CCoeControl *c = w...
Thank You!
    Questions?




Qt for Symbian:  bit.ly/qtsymbian
Reference



• Download an SDK from:
   – Forum Nokia (http://forum.nokia.com)

   – Samsung Mobile Innovator (http://inno...
Upcoming SlideShare
Loading in...5
×

Mobile Development with Qt for Symbian

5,233

Published on

The long awaited port of Qt to the Symbian platform is set to be delivered later this year. In addition to being able to target a new platform, application developers will now be able to take advantage of new functionality in Qt to ensure their application integrates seamlessly with the underlying mobile operating system. This session features a brief introduction to the Symbian/S60 platform with a focus on mobile application development using Qt for the Symbian platform.

Presentation by Alessandro Portale held during Qt Developer Days 2009.

http://qt.nokia.com/developer/learning/elearning

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,233
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
227
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Mobile Development with Qt for Symbian"

  1. 1. Mobile Application Development with Qt for Symbian
  2. 2. Visit: bit.ly/qtsymbian ...get Qt for your phone Qt for Symbian:  bit.ly/qtsymbian
  3. 3. About Me Jason Barron Started Began in Switched to July, 2005 Support Development Qt for Symbian:  bit.ly/qtsymbian 3
  4. 4. About Me Alessandro Portale 09/02 – 01/07 02/07 – 03/08 04/08 – today Color management Qt tools Qt port to Symbian Qt for Symbian:  bit.ly/qtsymbian
  5. 5. Goal • Why use Qt for Symbian? • Learn what you need to get started. • Learn how to make great apps on Symbian. Qt for Symbian:  bit.ly/qtsymbian
  6. 6. Agenda • Getting Started • Application Development • UI Types • New “Mobile-esque” Features in 4.6 • Advanced integration Qt for Symbian:  bit.ly/qtsymbian
  7. 7. Why use Qt for Symbian? 1. Symbian is a relevant mobile platform. 2. Qt is an easy way to access Symbian. 3. Many of you already know Qt! Qt for Symbian:  bit.ly/qtsymbian
  8. 8. The Symbian Landscape Today S60 3.1, 3.2 S60 5.0 Symbian^1 S^2 S^3 S^4 Qt for Symbian:  bit.ly/qtsymbian
  9. 9. The Developer’s Shopping List SDK IDE Open C plugin (POSIX) Qt Qt for Symbian:  bit.ly/qtsymbian
  10. 10. Free Available From Binaries Can be used to compile Qt Apps WINSCW Yes Carbide.c++ Win32* Yes Yes GCC-E Yes S60 SDK ARM No** Yes (CodeSourcery) RVCT No ARM Ltd. ARM Yes Yes * Win32 binaries run in the Symbian Emulator ** Technically can compile Qt, but libraries containing WSD will not run Compilers Qt for Symbian:  bit.ly/qtsymbian
  11. 11. Agenda • Getting Started • Application Development • UI types • New “Mobile-esque” Features in 4.6 • Advanced integration Qt for Symbian:  bit.ly/qtsymbian
  12. 12. Demo Qt for Symbian:  bit.ly/qtsymbian
  13. 13. Application Development – From Scratch • Carbide's Qt project wizard • Editing the Ui Form • show(), showMaximized() or showFullScreen()? • Running the application in the emulator • Running the application on the phone Qt for Symbian:  bit.ly/qtsymbian
  14. 14. Demonstration Qt for Symbian:  bit.ly/qtsymbian
  15. 15. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  16. 16. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  17. 17. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  18. 18. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  19. 19. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  20. 20. Carbide's Qt project wizard Qt for Symbian:  bit.ly/qtsymbian
  21. 21. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  22. 22. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  23. 23. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  24. 24. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  25. 25. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  26. 26. Editing the Ui Form Qt for Symbian:  bit.ly/qtsymbian
  27. 27. Adjusting the show() call Qt for Symbian:  bit.ly/qtsymbian
  28. 28. Adjusting the show() call Qt for Symbian:  bit.ly/qtsymbian
  29. 29. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  30. 30. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  31. 31. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  32. 32. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  33. 33. Building and deploying for the device Qt for Symbian:  bit.ly/qtsymbian
  34. 34. Command Line C:qt...analogclock> qmake C:qt...analogclock> make debug-winscw C:qt...analogclock> make release-gcce C:qt...analogclock> make release-armv5 C:qt...analogclock> make sis Qt for Symbian:  bit.ly/qtsymbian
  35. 35. Port an existing application • Original application on the Desktop • Carbide's Qt .pro file import • Running the application in the emulator • Desktop Ui vs. Mobile Ui Qt for Symbian:  bit.ly/qtsymbian
  36. 36. Carbide's Qt .pro file import Qt for Symbian:  bit.ly/qtsymbian
  37. 37. Carbide's Qt .pro file import Qt for Symbian:  bit.ly/qtsymbian
  38. 38. Carbide's Qt .pro file import Qt for Symbian:  bit.ly/qtsymbian
  39. 39. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  40. 40. Running the application in the emulator Qt for Symbian:  bit.ly/qtsymbian
  41. 41. Desktop Ui vs. Mobile Ui Successful port? Qt for Symbian:  bit.ly/qtsymbian
  42. 42. Desktop Ui vs. Mobile Ui Mobile friendly Ui Qt for Symbian:  bit.ly/qtsymbian
  43. 43. Desktop Ui vs. Mobile Ui Including different Ui headers Qt for Symbian:  bit.ly/qtsymbian
  44. 44. Desktop Ui vs. Mobile Ui Instantiating and showing different Uis Qt for Symbian:  bit.ly/qtsymbian
  45. 45. Desktop Ui vs. Mobile Ui AppController knows the view as QObject that emits colorChanged() Qt for Symbian:  bit.ly/qtsymbian
  46. 46. Desktop Ui vs. Mobile Ui Both Uis emit a colorChanged() signal Qt for Symbian:  bit.ly/qtsymbian
  47. 47. Agenda • Getting Started • Application Development • UI Types • New “Mobile-esque” Features in 4.6 • Advanced integration Qt for Symbian:  bit.ly/qtsymbian
  48. 48. UI Types Qt for Symbian:  bit.ly/qtsymbian
  49. 49. Agenda • Getting Started • Application Development • UI Types • New “Mobile-esque” Features in 4.6 • Advanced integration Qt for Symbian:  bit.ly/qtsymbian
  50. 50. qmake Keywords • MMP_RULES • DEPLOYMENT • BLD_INF_RULES • ICON • TARGET • QMAKE_CXXFLAGS – .UID3 – .ARMCC – .EPOCHEAPSIZE – .WINSCW – .CAPABILITY Qt for Symbian:  bit.ly/qtsymbian
  51. 51. Input Method Hints … QWidget::inputMethodHints() const; void QWidget::setInputMethodHints(…); Qt for Symbian:  bit.ly/qtsymbian
  52. 52. Input Method Hints • Change Behavior: • Restrict Input: – Qt::ImhHiddenText – Qt::ImhDigitsOnly – Qt::ImhNoAutoUppercase – Qt::ImhFormattedNumbersOnly – Qt::ImhPreferNumbers – Qt::ImhUppercaseOnly – Qt::ImhPreferUppercase – Qt::ImhLowercaseOnly – Qt::ImhPreferLowercase – Qt::ImhDialableCharactersOnly – Qt::ImhNoPredictiveText – Qt::ImhEmailCharactersOnly • Masks: – Qt::ImhExclusiveInputMask Qt for Symbian:  bit.ly/qtsymbian
  53. 53. Soft keys QAction::setSoftKeyRole(…); …QAction::softKeyRole() const; enum SoftKeyRole { QAction::NoSoftKey, //(default) QAction::PositiveSoftKey, QAction::NegativeSoftKey, QAction::SelectSoftKey, } Qt for Symbian:  bit.ly/qtsymbian
  54. 54. Navigation Modes void QApplication::setNavigationMode(...); ... QApplication::navigationMode(); enum NavigationMode { NavigationModeNone, NavigationModeKeypadTabOrder, NavigationModeKeypadDirectional, NavigationModeCursorAuto, NavigationModeCursorForceVisible }; Qt for Symbian:  bit.ly/qtsymbian
  55. 55. Exceptions What happens if ‘new’ on line 4 throws std::bad_alloc? MyWidget::MyWidget(QWidget *parent) : QDialog(parent), label(new QLabel("Name?", this)), edit(new QLineEdit(this)), button(new QPushButton("Ok")) { setLayout(new QVBoxLayout); layout()->addWidget(label); layout()->addWidget(edit); layout()->addWidget(button); } Qt for Symbian:  bit.ly/qtsymbian
  56. 56. QScopedPointer Deletes it’s object when the scope terminates. class MyWidget: public QDialog { Q_OBJECT public: MyWidget(QWidget *parent = 0); private: #ifdef USE_SCOPED_POINTER QScopedPointer<QLabel> label; QScopedPointer<QLineEdit> edit; QScopedPointer<QPushButton> button; #else QLabel *label; QLineEdit *edit; QPushButton *button; #endif }; Qt for Symbian:  bit.ly/qtsymbian
  57. 57. Agenda • Getting Started • Application Development • UI Types • New “Mobile-esque” Features in 4.6 • Advanced integration Qt for Symbian:  bit.ly/qtsymbian
  58. 58. Event Dispatcher – Active Scheduler • Active objects can be used as normal ActiveScheduler Qt Qt for Symbian:  bit.ly/qtsymbian
  59. 59. Handling Symbian Leaves • QT_TRAP_THROWING – Converts leaves to exceptions • QT_TRYCATCH_ERROR – Converts exceptions to errors • QT_TRYCATCH_LEAVING – Converts exceptions to leaves Qt for Symbian:  bit.ly/qtsymbian
  60. 60. RWindow, CCoeControl and QWidget • QWidget::winId() – Returns a CCoeControl • Always window owning: CCoeControl *c = widget->effectiveWinId(); RWindow *rw = static_cast<RWindow*>(c->DrawableWindow()); Qt for Symbian:  bit.ly/qtsymbian
  61. 61. Thank You! Questions? Qt for Symbian:  bit.ly/qtsymbian
  62. 62. Reference • Download an SDK from: – Forum Nokia (http://forum.nokia.com) – Samsung Mobile Innovator (http://innovator.samsungmobile.com) – Symbian Foundation (http://developer.symbian.com) Qt for Symbian:  bit.ly/qtsymbian 62
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×