Adenilson Cavalcanti Adenilson Cavalcanti Bsc. Msc. Bsc. Msc. KDE developer KDE developer WebKit contributor WebKit contributor Effective QML Effective QML Best practices for developing with Qt Quick Best practices for developing with Qt Quick
Jul 13, 2015
Adenilson CavalcantiAdenilson CavalcantiBsc. Msc.Bsc. Msc.
KDE developerKDE developerWebKit contributorWebKit contributor
Effective QMLEffective QMLBest practices for developing with Qt QuickBest practices for developing with Qt Quick
11/19/12 2
Presentation structure
The case for QML
How to train yourself or a team
Overview on QML
Good practices
Advanced techniques
11/19/12 3
What is this Q-Whatchamacallit?
* http://en.wikpedia.org/wiki/QML
Qt Meta Language (QML)*Declarative vs Imperative
11/19/12 4
A case study: QML x QGV*
Requirements: 1 top bar1 lower barscrolling kinetic list in the centerre-scalable
*QGV stands for QGraphicsView
11/19/12 6
Which one will be more verbose?
Which one will be faster to develop?
A case study: QML x QGV
11/19/12 7
Results
A case study: QML x QGV
QGV QML0
200
400
600
800
1000
1200
1400
1600
LOC
Line
s of
cod
e
11/19/12 9
A difference of almost 1000% in development timeQGV: 1 ½ day (8-10 hours)*QML: 1 hour (+ 30 minutes for minor adjustments)
A case study: QML x QGV
*Assuming a ready to use KineticScrolling list and a basic Button
11/19/12 10
Question: if you start a new project today, which one will be done earlier?
A case study: QML x QGV
11/19/12 16
Relevant questionsWhat your app need?Desktop x TouchscreenAnimations?Designer assets?
96 Widgets! Not counting all KDE widget or Qt add-ons...
11/19/12 20
Trainment
Students: use the power of Opensource!Great online documentationQt is opensourceKDEgSoC
11/19/12 21
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 24
Trainment
Qt has a real ecosystemICS (USA based)KDAB (Europe)Digia (owned Trolltech)Collabora (ninja-ish guys)
11/19/12 26
QML: 101
QML elementsVisual: 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