QtEmbedded

88
Qt tales from the embedded trenches Cabledogs (savago, igolivei) 2011

description

Qt embedded presentation in FOSDEM2011.

Transcript of QtEmbedded

Page 1: QtEmbedded

Qt tales from the embeddedtrenchesCabledogs (savago, igolivei)2011

Page 2: QtEmbedded

About us

Adenilson Cavalcanti (Savago): KDE-pim, KDE-Plasma, IMTK, libgcal,amora

Igor Trindade Oliveira (igolive): KDE-pim, KDE-plasma, Gallium

Page 3: QtEmbedded

Structure

A problem is given

A solution is proposed

Discussion

Page 4: QtEmbedded

Topics

1 Kinectic scrolling pain

2 Meego UI without libmeegotouch?

3 Sliding Widgets

4 JSON parsing

5 D-BUS

6 Responsiveness

7 Symbian on Linux

Page 5: QtEmbedded

Kinetic Scrolling

Page 6: QtEmbedded

Kinetic example: iPhone 2007

Page 7: QtEmbedded

Prior art?Bill Buxton: Two-handed input in HCI, 1982Canola 2007

etc

Page 8: QtEmbedded

Prior art?Bill Buxton: Two-handed input in HCI, 1982Canola 2007

etc

Page 9: QtEmbedded

Prior art?Bill Buxton: Two-handed input in HCI, 1982Canola 2007

etc

Page 10: QtEmbedded

Prior art?Bill Buxton: Two-handed input in HCI, 1982Canola 2007

etc

Page 11: QtEmbedded

A personal favorite: Canola 2007

Page 12: QtEmbedded

What about Qt? flickable 2008

Page 13: QtEmbedded

How scrolling works?

Page 14: QtEmbedded

How kinetic scrolling works?

Displacement is defined in factor of:

attenuation given by Easing curve

time elapsed between the drag event

other factors (e.g. friction, etc)

optimizations: clipping, lazy loading, ring buffer, snapshots, etc

Page 15: QtEmbedded

Demo timeC++: toyflick

QML

Looking at the pros

Page 16: QtEmbedded

Currently known Qt-basedimplementations

Ariya’s Flickable 2008

toyflick 2009

Plasma ScrollWidget 2009

IMTK ImtkKinecticListView 2010

QML Flickable 2010

Page 17: QtEmbedded

Meego UI withoutlibmeegotouch?

Page 18: QtEmbedded

Meego app

Ok, somewhat old example...

Page 19: QtEmbedded

Can it run on Symbian?Short answer: NOT!Long answer: it could be ported...

You have 1 day!

Solution: cheat!

Page 20: QtEmbedded

Can it run on Symbian?Short answer: NOT!Long answer: it could be ported...

You have 1 day!

Solution: cheat!

Page 21: QtEmbedded

Can it run on Symbian?Short answer: NOT!Long answer: it could be ported...

You have 1 day!

Solution: cheat!

Page 22: QtEmbedded

Can it run on Symbian?Short answer: NOT!Long answer: it could be ported...

You have 1 day!

Solution: cheat!

Page 23: QtEmbedded

Can it run on Symbian?Short answer: NOT!Long answer: it could be ported...

You have 1 day!

Solution: cheat!

Page 24: QtEmbedded

UI elements

Page 25: QtEmbedded

UI elements

Page 26: QtEmbedded

UI elements

Page 27: QtEmbedded

UI elements

Page 28: QtEmbedded

UI elements

Page 29: QtEmbedded

Final result

Page 30: QtEmbedded

Pure blood Qt runs everywhere!

Page 31: QtEmbedded

’Minor’ details: 7 months ago

Forgot the Buttons...

Rescalable button backgrounds

Borders on background

Centered Icons

Layouts/sizeHints sometimes are tricky

Page 32: QtEmbedded

’Minor’ details: 7 months ago

Forgot the Buttons...

Rescalable button backgrounds

Borders on background

Centered Icons

Layouts/sizeHints sometimes are tricky

Page 33: QtEmbedded

’Minor’ details: 7 months ago

Forgot the Buttons...

Rescalable button backgrounds

Borders on background

Centered Icons

Layouts/sizeHints sometimes are tricky

Page 34: QtEmbedded

’Minor’ details: 7 months ago

Forgot the Buttons...

Rescalable button backgrounds

Borders on background

Centered Icons

Layouts/sizeHints sometimes are tricky

Page 35: QtEmbedded

’Minor’ details: 7 months ago

Forgot the Buttons...

Rescalable button backgrounds

Borders on background

Centered Icons

Layouts/sizeHints sometimes are tricky

Page 36: QtEmbedded

’Minor’ details: today

Rescalable button backgrounds: QML BorderImage

Borders: QML BorderImage

Centered Icons: maybe Qt components

Layouts/sizeHints: QML anchors

Page 37: QtEmbedded

’Minor’ details: today

Rescalable button backgrounds: QML BorderImage

Borders: QML BorderImage

Centered Icons: maybe Qt components

Layouts/sizeHints: QML anchors

Page 38: QtEmbedded

’Minor’ details: today

Rescalable button backgrounds: QML BorderImage

Borders: QML BorderImage

Centered Icons: maybe Qt components

Layouts/sizeHints: QML anchors

Page 39: QtEmbedded

’Minor’ details: today

Rescalable button backgrounds: QML BorderImage

Borders: QML BorderImage

Centered Icons: maybe Qt components

Layouts/sizeHints: QML anchors

Page 40: QtEmbedded

Demo timeC++: frame

Animated layout items

Page 41: QtEmbedded

Sliding widgets

Page 42: QtEmbedded

Example: iPhone contact list

Page 43: QtEmbedded

How to do it?

Page 44: QtEmbedded

step1: have a specialized layout

Page 45: QtEmbedded

step2: put widget side by side

Page 46: QtEmbedded

step3: make both visible...

Page 47: QtEmbedded

step4: animate!

Page 48: QtEmbedded

step5: hide the old widget

Page 49: QtEmbedded

Demo timeC++: slider

Page 50: QtEmbedded

’Minor’ details: 7 months ago

QGraphicsLayout is not a QObjectMultiple heritance is nasty!

Parenting issues of widgets

No documentation, of course...

Page 51: QtEmbedded

’Minor’ details: 7 months ago

QGraphicsLayout is not a QObjectMultiple heritance is nasty!

Parenting issues of widgets

No documentation, of course...

Page 52: QtEmbedded

’Minor’ details: 7 months ago

QGraphicsLayout is not a QObjectMultiple heritance is nasty!

Parenting issues of widgets

No documentation, of course...

Page 53: QtEmbedded

’Minor’ details: 7 months ago

QGraphicsLayout is not a QObjectMultiple heritance is nasty!

Parenting issues of widgets

No documentation, of course...

Page 54: QtEmbedded

’Minor’ details: today

Qt Components has PageStack

Page 55: QtEmbedded

JSON parsing

Page 56: QtEmbedded

Qt doesn’t parse JSON?

Page 57: QtEmbedded

Qt doesn’t parse JSON?

SAY WHAAAT!!?

Page 58: QtEmbedded

Solution: QJSON

Really easy to use

Tested on embedded platforms

License is LGPL

Use it. Really.

Page 59: QtEmbedded

Solution: QJSON

Really easy to use

Tested on embedded platforms

License is LGPL

Use it. Really.

Page 60: QtEmbedded

Solution: QJSON

Really easy to use

Tested on embedded platforms

License is LGPL

Use it. Really.

Page 61: QtEmbedded

Solution: QJSON

Really easy to use

Tested on embedded platforms

License is LGPL

Use it. Really.

Page 62: QtEmbedded

D-BUS

Page 63: QtEmbedded

The-BUS

Page 64: QtEmbedded

Rules of thumb

Small batches of items

Marshalling/de-marshall: operator<<

Your itemmust be a QObject

D-Feet is your friend

Page 65: QtEmbedded

Rules of thumb

Small batches of items

Marshalling/de-marshall: operator<<

Your itemmust be a QObject

D-Feet is your friend

Page 66: QtEmbedded

Rules of thumb

Small batches of items

Marshalling/de-marshall: operator<<

Your itemmust be a QObject

D-Feet is your friend

Page 67: QtEmbedded

Rules of thumb

Small batches of items

Marshalling/de-marshall: operator<<

Your itemmust be a QObject

D-Feet is your friend

Page 68: QtEmbedded

Responsiveness

Page 69: QtEmbedded

Responsiveness

Page 70: QtEmbedded

Simple! Threads!

Page 71: QtEmbedded

Why sometimes is a bad idea...

Hard to debug

Resource consumption

Embedded limitations

Page 72: QtEmbedded

Why sometimes is a bad idea...

Hard to debug

Resource consumption

Embedded limitations

Page 73: QtEmbedded

Why sometimes is a bad idea...

Hard to debug

Resource consumption

Embedded limitations

Page 74: QtEmbedded

"Are for people who can’t use statemachines."

Solution: Divide and conquer

Page 75: QtEmbedded

"Are for people who can’t use statemachines."

Solution: Divide and conquer

Page 76: QtEmbedded

Demo timeD-BUS server

JSON data

QML UI

Page 77: QtEmbedded

Symbian: Can Tux sing theBlues?

Page 78: QtEmbedded

Symbian?

Page 79: QtEmbedded

Yes!

Page 80: QtEmbedded

Demo timeCompiling a shared library

Compiling an app

Page 81: QtEmbedded

The end?

Page 82: QtEmbedded

Vacations, of course!

Page 83: QtEmbedded

Vacations

Page 84: QtEmbedded

Vacations

Page 85: QtEmbedded

Vacations

Page 86: QtEmbedded

Vacations

Page 87: QtEmbedded

By the way...

Page 88: QtEmbedded

Thanks!E-mail: [email protected]

Site: http://savago.wordpress.com

Site: http://www.openbossa.org.br