50
Qt Item Views The Next Generation

Qt Itemviews, The Next Generation (Bossa09)

Embed Size (px)

Citation preview

Page 1: Qt Itemviews, The Next Generation (Bossa09)

Qt Item ViewsThe Next Generation

Page 2: Qt Itemviews, The Next Generation (Bossa09)

• Marius Bugge Monsen

• Qt Software, Nokia

• Senior SW Engineer

• Lead, Qt Widget Team 2

Page 3: Qt Itemviews, The Next Generation (Bossa09)

• What is it?

• Why do we need a “Next Generation”?

• How does it work?

Qt Item Views

Page 4: Qt Itemviews, The Next Generation (Bossa09)

List View Table View Tree View

Page 5: Qt Itemviews, The Next Generation (Bossa09)
Page 6: Qt Itemviews, The Next Generation (Bossa09)
Page 7: Qt Itemviews, The Next Generation (Bossa09)

• Experience

• Graphics View

• Animation Framework

• Competition

Page 8: Qt Itemviews, The Next Generation (Bossa09)

Creative Friday

Page 9: Qt Itemviews, The Next Generation (Bossa09)

Warning:Work in progress!

Page 10: Qt Itemviews, The Next Generation (Bossa09)

View Controller

Model

Page 11: Qt Itemviews, The Next Generation (Bossa09)

Data and logicSelection state

Presentation Behavior

Page 12: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation Behavior

Page 13: Qt Itemviews, The Next Generation (Bossa09)

QListModelInterface QListSelectionManager

QGraphicsListView QListController

Data

InputOutput

Page 14: Qt Itemviews, The Next Generation (Bossa09)

QListSelectionManager

QGraphicsListView QListController

Data

InputOutput

Page 15: Qt Itemviews, The Next Generation (Bossa09)

QListWidgetNG

QListSelectionManager

QGraphicsListView QListController

Page 16: Qt Itemviews, The Next Generation (Bossa09)

QListWidgetNG

QListDefaultModel QListSelectionManager

QGraphicsListView QListController

Page 17: Qt Itemviews, The Next Generation (Bossa09)

int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.show(); return app.exec();}

Page 18: Qt Itemviews, The Next Generation (Bossa09)

int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.controller()->setModel(new MyData(&widget)); widget.show(); return app.exec();}

Page 19: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

QGraphicsListView Behavior

Page 20: Qt Itemviews, The Next Generation (Bossa09)

Item

View

Page 21: Qt Itemviews, The Next Generation (Bossa09)

Item

Invisible item

Page 22: Qt Itemviews, The Next Generation (Bossa09)

Item

Invisible item

Page 23: Qt Itemviews, The Next Generation (Bossa09)

Item

Invisible item

Page 24: Qt Itemviews, The Next Generation (Bossa09)

QGraphicsWidget

QGraphicsWidget

Page 25: Qt Itemviews, The Next Generation (Bossa09)

QGraphicsWidget

QPropertyAnimation

Position

Opacity

Scale

Rotation

Size

Page 26: Qt Itemviews, The Next Generation (Bossa09)

Me

QGraphicsSimpleTextItem

QGraphicsPixmapItemQGraphicsSvgItem

QGraphicsLayout

Page 27: Qt Itemviews, The Next Generation (Bossa09)

‘SUP DAWG YO I HERD U LIKE ITEM VIEWS...

Page 28: Qt Itemviews, The Next Generation (Bossa09)

View

ViewView

Page 29: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

QGraphicsListView Behavior

Page 30: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Behavior

Page 31: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Behavior

Page 32: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

PathListView Behavior

Page 33: Qt Itemviews, The Next Generation (Bossa09)
Page 34: Qt Itemviews, The Next Generation (Bossa09)

int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.controller()->setView(new MyPathView); widget.show(); return app.exec();}

Page 35: Qt Itemviews, The Next Generation (Bossa09)

Item

View

Page 36: Qt Itemviews, The Next Generation (Bossa09)

Item

View

Page 37: Qt Itemviews, The Next Generation (Bossa09)

Demo

Page 38: Qt Itemviews, The Next Generation (Bossa09)

View or Layout ?

Page 39: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation Behavior

Page 40: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation QListController

Page 41: Qt Itemviews, The Next Generation (Bossa09)

Item

View Input Events

Controller

Page 42: Qt Itemviews, The Next Generation (Bossa09)

Item

View Scrollbar

Controller

Page 43: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation QListController

Page 44: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation

Page 45: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation

Page 46: Qt Itemviews, The Next Generation (Bossa09)

Data and logic Selection state

Presentation QKineticListController

Page 47: Qt Itemviews, The Next Generation (Bossa09)

int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget(new QKineticListController); widget.show(); return app.exec();}

Page 48: Qt Itemviews, The Next Generation (Bossa09)

Demo

Page 50: Qt Itemviews, The Next Generation (Bossa09)

Thank you!

Questions?