the next generation qt item views

75
Qt Item Views The Next Generation

Upload: qt-project

Post on 12-May-2015

2.782 views

Category:

Technology


3 download

DESCRIPTION

The Qt Kinetic project is an initiative to provide powerful frameworks to create dynamic, beautiful graphical user interfaces in Qt. As an extension of this effort, the next generation of Qt's item views framework is being designed with animated user interfaces in mind. This talk will give an introduction to the Item Views NG project and the new architecture that is being proposed. Presentation by Marius Bugge Monsen held during Qt Developer Days 2009. http://qt.nokia.com/developer/learning/elearning

TRANSCRIPT

Page 1: The Next Generation Qt Item Views

Qt Item ViewsThe Next Generation

Page 2: The Next Generation Qt Item Views

• Marius Bugge Monsen (mbm)

• Qt Developer

• Qt Widget Team Lead

Page 3: The Next Generation Qt Item Views

• What is Qt Item Views?

• Why a “Next Generation”?

• How Does it Work?

• Can I Start Using It?

Qt Item ViewsThe Next Generation

Page 4: The Next Generation Qt Item Views

What Is Qt Item Views?

Page 5: The Next Generation Qt Item Views
Page 6: The Next Generation Qt Item Views

QListView QTableView QTreeView

Page 7: The Next Generation Qt Item Views

• QWidget-based

• Model-View

• Since Qt 4.0

Page 8: The Next Generation Qt Item Views

Creative Friday!

Page 9: The Next Generation Qt Item Views

Why a “Next Generation”?

Page 10: The Next Generation Qt Item Views

... and why now?

Page 11: The Next Generation Qt Item Views
Page 12: The Next Generation Qt Item Views
Page 13: The Next Generation Qt Item Views
Page 14: The Next Generation Qt Item Views

• Lessons Learned

• Qt Development

• Competition

Page 15: The Next Generation Qt Item Views

• Design Lessons

• Different views - different use-cases

• Eye-candy matters

• KISS

Page 16: The Next Generation Qt Item Views

• Process Lessons

• Be open

• Use the API

• Encourage others to use the API

Page 17: The Next Generation Qt Item Views

• So What Do We Want ?

Page 18: The Next Generation Qt Item Views

Shark_food by starstreak007 on flickr

Page 19: The Next Generation Qt Item Views

• Features

• Fast

• Integrated

• Hardware Accelerated

Page 20: The Next Generation Qt Item Views

• API

• Discoverable

• Structured

• Clear

Page 21: The Next Generation Qt Item Views

• Implementation

• Simple

• Clean

• Testable

Page 22: The Next Generation Qt Item Views

How Does It Work?

Page 23: The Next Generation Qt Item Views

View Controller

Model

Page 24: The Next Generation Qt Item Views

Data and logicSelection state

Presentation Behavior

Page 25: The Next Generation Qt Item Views

Data and logic Selection state

Presentation Behavior

Page 26: The Next Generation Qt Item Views

QListModelInterface QListSelectionManager

QGraphicsListView QListController

Data

InputOutput

Page 27: The Next Generation Qt Item Views

QListModelInterfacevs.

QAbstractItemModel

Page 28: The Next Generation Qt Item Views

• Optimizable

• Maintainable

• Expandable

Page 29: The Next Generation Qt Item Views

Tree Model

List View

Adaptor

Page 30: The Next Generation Qt Item Views

QListWidgetNG

QListDefaultModel QListSelectionManager

QGraphicsListView QListController

Page 31: The Next Generation Qt Item Views

Graphics View

Item View

Page 32: The Next Generation Qt Item Views

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

Page 33: The Next Generation Qt Item Views

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

Page 34: The Next Generation Qt Item Views

Data and logic Selection state

QGraphicsListView Behavior

Page 35: The Next Generation Qt Item Views

• View or Layout?

Page 36: The Next Generation Qt Item Views

Item

View

Page 37: The Next Generation Qt Item Views

Item

Invisible item

Page 38: The Next Generation Qt Item Views

Item

Invisible item

Page 39: The Next Generation Qt Item Views

Item

Invisible item

Page 40: The Next Generation Qt Item Views

QGraphicsWidget

QGraphicsWidget

Page 41: The Next Generation Qt Item Views

QGraphicsWidget

QPropertyAnimation

Position

Opacity

Scale

Rotation

Size

Page 42: The Next Generation Qt Item Views

Demo

Page 43: The Next Generation Qt Item Views

Me

QGraphicsSimpleTextItem

QGraphicsPixmapItemQGraphicsSvgItem

QGraphicsLayout

Page 44: The Next Generation Qt Item Views

Item

Me

View

Page 45: The Next Generation Qt Item Views

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

Page 46: The Next Generation Qt Item Views

ViewView

View

Page 47: The Next Generation Qt Item Views

Data and logic Selection state

QGraphicsListView Behavior

Page 48: The Next Generation Qt Item Views

Data and logic Selection state

Behavior

Page 49: The Next Generation Qt Item Views

Data and logic Selection state

Behavior

Page 50: The Next Generation Qt Item Views

Data and logic Selection state

PathListView Behavior

Page 51: The Next Generation Qt Item Views
Page 52: The Next Generation Qt Item Views

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

Page 53: The Next Generation Qt Item Views

Item

View

Page 54: The Next Generation Qt Item Views

Item

View

Page 55: The Next Generation Qt Item Views

Demo

Page 56: The Next Generation Qt Item Views

Data and logic Selection state

Presentation Behavior

Page 57: The Next Generation Qt Item Views

Data and logic Selection state

Presentation QListController

Page 58: The Next Generation Qt Item Views

Input Events

ControllerModel

Page 59: The Next Generation Qt Item Views

Item

View Input Events

Controller

Page 60: The Next Generation Qt Item Views

Item

View Scrollbar

Controller

Page 61: The Next Generation Qt Item Views

Data and logic Selection state

Presentation QListController

Page 62: The Next Generation Qt Item Views

Data and logic Selection state

Presentation

Page 63: The Next Generation Qt Item Views

Data and logic Selection state

Presentation

Page 64: The Next Generation Qt Item Views

Data and logic Selection state

Presentation QKineticListController

Page 65: The Next Generation Qt Item Views

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

Page 66: The Next Generation Qt Item Views

Can I Start Using It?

Page 67: The Next Generation Qt Item Views

• Yes

Page 68: The Next Generation Qt Item Views

• Yes, but ...

Page 69: The Next Generation Qt Item Views

Research!

Page 70: The Next Generation Qt Item Views

• Current status

• Integrating in existing applications

• Profiling and optimizing

Page 71: The Next Generation Qt Item Views

• Current status

• Missing features

• API may change

Page 72: The Next Generation Qt Item Views

• Unsolved problem

• Data Invalidation

Page 73: The Next Generation Qt Item Views

“Don’t expect, inspect!”

Page 75: The Next Generation Qt Item Views

Thank you!

Questions?