SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Effective QML
Best practices for developing with Qt Quick




                                          Adenilson Cavalcanti
                                                        Bsc. Msc.
                                                  KDE developer
                                                WebKit contributor
Presentation structure

    The case for QML

    How to train yourself or a team

    Overview on QML

    Good practices

    Advanced techniques


11/19/12                                               2
What is this Q-Whatchamacallit?



    Qt Meta Language (QML)*
    Declarative vs Imperative




                                      * http://en.wikpedia.org/wiki/QML


11/19/12                                                              3
A case study: QML x QGV*

    Requirements:
    1 top bar
    1 lower bar
    scrolling kinetic list in the center
    re-scalable




                                           *QGV stands for QGraphicsView


11/19/12                                                               4
A case study: QML x QGV

    QGV vs QML: are different, but can solve similar
    problems.




11/19/12                                               5
A case study: QML x QGV

    Which one will be more verbose?

    Which one will be faster to develop?




11/19/12                                             6
A case study: QML x QGV

    Results
                           1600


                           1400


                           1200


                           1000
           Lines of code




                           800                       LOC

                           600


                           400


                           200


                             0

                                  QGV      QML



11/19/12                                                      7
A case study: QML x QGV

A difference of almost 1000% in development time
  QGV: 1 ½ day (8-10 hours)*
  QML: 1 hour (+ 30 minutes for minor adjustments)




                       *Assuming a ready to use KineticScrolling list and a basic Button


11/19/12                                                                                   9
A case study: QML x QGV

    Question: if you start a new project today, which
    one will be done earlier?




11/19/12                                                10
QML: what it means for...

    Managers x designers x developers




11/19/12                                            11
Should I put C++ out of the equation?




                            Porto de Galinhas (Pernambuco) - Brazil


11/19/12                                                         12
QML and C++

Relevant questions
  Complexity
  Functionality
  Team




11/19/12                       13
What about QWidgets?




11/19/12                      14
How many QWidgets?




11/19/12                    15
96 Widgets! Not counting all KDE widget or Qt add-ons...

Relevant questions
  What your app need?
  Desktop x Touchscreen
  Animations?
  Designer assets?




11/19/12                                               16
Right tool to the right job




                       DevDays@California - 2008


11/19/12                                      17
Trainment

    How to become QML-proficient?




11/19/12                                   18
Trainment

    If you are a student




                              Yeah, Matrix.


11/19/12                                 19
Trainment

Students: use the power of Opensource!
  Great online documentation
  Qt is opensource
  KDE
  gSoC




11/19/12                                        20
Trainment

Lessons for students:
  Making mistakes is part of learning process

    The one who make more points is also the one
    who makes more mistakes

    While learning, look for the best!




11/19/12                                           21
Relax time...




           Ilha Bela (Sao Paulo) - Brazil


11/19/12                               22
Trainment

    If you are a professional/manager




11/19/12                                       23
Trainment

Qt has a real ecosystem
  ICS (USA based)
  KDAB (Europe)
  Digia (owned Trolltech)
  Collabora (ninja-ish guys)




11/19/12                              24
Services

    If you need it today!!!11!




                                 Must have Star Wars reference


11/19/12                                                    25
QML: 101

QML elements
 Visual: Rectangle, Image, BorderImage, Text, TextEdit, TextInput,
    AnimatedImage, Gradient
    Positioner/Repeater: Column, Row, Grid, Flow, Repeater
    Views: ListView, GridView, PathView
    Utilities: Connection, Loader, Timer, WorkerScript,
    Path(Line/Quad/Cubic/Attribute/etc)
    Animations: Property, Number, Vector3d, Color, Rotation,
    Parent, Anchor
    Models: ListModel, ListElement, XmlListModel, etc


11/19/12                                                         26
QML: 101

    We lack time to cover it all...




11/19/12                                     27
The end?




11/19/12              28
The end?




           Not really...




11/19/12                          29
To be continued...




11/19/12                        30

Weitere ähnliche Inhalte

Mehr von Adenilson Cavalcanti (6)

KLF_chromium02
KLF_chromium02KLF_chromium02
KLF_chromium02
 
How Servo Renders the Web
How Servo Renders the WebHow Servo Renders the Web
How Servo Renders the Web
 
QtEmbedded
QtEmbeddedQtEmbedded
QtEmbedded
 
Fisl10 adenilson08
Fisl10 adenilson08Fisl10 adenilson08
Fisl10 adenilson08
 
Amora
AmoraAmora
Amora
 
Adenilson cavalcanti devdays12_part2
Adenilson cavalcanti devdays12_part2Adenilson cavalcanti devdays12_part2
Adenilson cavalcanti devdays12_part2
 

Adenilson cavalcanti devdays12_part1

  • 1. Effective QML Best practices for developing with Qt Quick Adenilson Cavalcanti Bsc. Msc. KDE developer WebKit contributor
  • 2. Presentation structure The case for QML How to train yourself or a team Overview on QML Good practices Advanced techniques 11/19/12 2
  • 3. What is this Q-Whatchamacallit? Qt Meta Language (QML)* Declarative vs Imperative * http://en.wikpedia.org/wiki/QML 11/19/12 3
  • 4. A case study: QML x QGV* Requirements: 1 top bar 1 lower bar scrolling kinetic list in the center re-scalable *QGV stands for QGraphicsView 11/19/12 4
  • 5. A case study: QML x QGV QGV vs QML: are different, but can solve similar problems. 11/19/12 5
  • 6. A case study: QML x QGV Which one will be more verbose? Which one will be faster to develop? 11/19/12 6
  • 7. A case study: QML x QGV Results 1600 1400 1200 1000 Lines of code 800 LOC 600 400 200 0 QGV QML 11/19/12 7
  • 8. A case study: QML x QGV A difference of almost 1000% in development time QGV: 1 ½ day (8-10 hours)* QML: 1 hour (+ 30 minutes for minor adjustments) *Assuming a ready to use KineticScrolling list and a basic Button 11/19/12 9
  • 9. A case study: QML x QGV Question: if you start a new project today, which one will be done earlier? 11/19/12 10
  • 10. QML: what it means for... Managers x designers x developers 11/19/12 11
  • 11. Should I put C++ out of the equation? Porto de Galinhas (Pernambuco) - Brazil 11/19/12 12
  • 12. QML and C++ Relevant questions Complexity Functionality Team 11/19/12 13
  • 15. 96 Widgets! Not counting all KDE widget or Qt add-ons... Relevant questions What your app need? Desktop x Touchscreen Animations? Designer assets? 11/19/12 16
  • 16. Right tool to the right job DevDays@California - 2008 11/19/12 17
  • 17. Trainment How to become QML-proficient? 11/19/12 18
  • 18. Trainment If you are a student Yeah, Matrix. 11/19/12 19
  • 19. Trainment Students: use the power of Opensource! Great online documentation Qt is opensource KDE gSoC 11/19/12 20
  • 20. Trainment Lessons for students: Making mistakes is part of learning process The one who make more points is also the one who makes more mistakes While learning, look for the best! 11/19/12 21
  • 21. Relax time... Ilha Bela (Sao Paulo) - Brazil 11/19/12 22
  • 22. Trainment If you are a professional/manager 11/19/12 23
  • 23. Trainment Qt has a real ecosystem ICS (USA based) KDAB (Europe) Digia (owned Trolltech) Collabora (ninja-ish guys) 11/19/12 24
  • 24. Services If you need it today!!!11! Must have Star Wars reference 11/19/12 25
  • 25. QML: 101 QML elements Visual: Rectangle, Image, BorderImage, Text, TextEdit, TextInput, AnimatedImage, Gradient Positioner/Repeater: Column, Row, Grid, Flow, Repeater Views: ListView, GridView, PathView Utilities: Connection, Loader, Timer, WorkerScript, Path(Line/Quad/Cubic/Attribute/etc) Animations: Property, Number, Vector3d, Color, Rotation, Parent, Anchor Models: ListModel, ListElement, XmlListModel, etc 11/19/12 26
  • 26. QML: 101 We lack time to cover it all... 11/19/12 27
  • 28. The end? Not really... 11/19/12 29