impress template: xuhai 2 - software experts in qt, c++ ... · best practices for developing with...

29
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

Upload: others

Post on 23-Feb-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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

Page 2: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 2

Presentation structure

The case for QML

How to train yourself or a team

Overview on QML

Good practices

Advanced techniques

Page 3: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 3

What is this Q-Whatchamacallit?

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

Qt Meta Language (QML)*Declarative vs Imperative

Page 4: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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

Page 5: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 5

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

A case study: QML x QGV

Page 6: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 6

Which one will be more verbose?

Which one will be faster to develop?

A case study: QML x QGV

Page 7: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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

Page 8: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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

Page 9: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 10

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

A case study: QML x QGV

Page 10: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 11

Managers x designers x developers

QML: what it means for...

Page 11: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 12

Should I put C++ out of the equation?

Porto de Galinhas (Pernambuco) - Brazil

Page 12: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 13

Relevant questionsComplexityFunctionalityTeam

QML and C++

Page 13: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 14

What about QWidgets?

Page 14: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 15

How many QWidgets?

Page 15: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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...

Page 16: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 17

Right tool to the right job

DevDays@California - 2008

Page 17: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 18

Trainment

How to become QML-proficient?

Page 18: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 19

Trainment

If you are a student

Yeah, Matrix.

Page 19: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 20

Trainment

Students: use the power of Opensource!Great online documentationQt is opensourceKDEgSoC

Page 20: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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!

Page 21: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 22

Relax time...

Ilha Bela (Sao Paulo) - Brazil

Page 22: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 23

Trainment

If you are a professional/manager

Page 23: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 24

Trainment

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

Page 24: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 25

Services

If you need it today!!!11!

Must have Star Wars reference

Page 25: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

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

Page 26: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 27

We lack time to cover it all...

QML: 101

Page 27: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 28

The end?

Page 28: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 29

The end?

Not really...

Page 29: Impress Template: Xuhai 2 - Software Experts in Qt, C++ ... · Best practices for developing with Qt Quick. 11/19/12 2 Presentation structure The case for QML How to train yourself

11/19/12 30

To be continued...