Upload
marius-bugge-monsen
View
853
Download
2
Tags:
Embed Size (px)
Citation preview
Qt Item ViewsThe Next Generation
• Marius Bugge Monsen (mbm)
• Qt Developer
• Qt Widget Team Lead
• What is Qt Item Views?
• Why a “Next Generation”?
• How Does it Work?
• Can I Start Using It?
Qt Item ViewsThe Next Generation
What Is Qt Item Views?
QListView QTableView QTreeView
• QWidget-based
• Model-View
• Since Qt 4.0
Creative Friday!
Why a “Next Generation”?
... and why now?
• Lessons Learned
• Qt Development
• Competition
• Design Lessons
• Different views - different use-cases
• Eye-candy matters
• KISS
• Process Lessons
• Be open
• Use the API
• Encourage others to use the API
• So What Do We Want ?
Shark_food by starstreak007 on flickr
• Features
• Fast
• Integrated
• Hardware Accelerated
• API
• Discoverable
• Structured
• Clear
• Implementation
• Simple
• Clean
• Testable
How Does It Work?
View Controller
Model
Data and logicSelection state
Presentation Behavior
Data and logic Selection state
Presentation Behavior
QListModelInterface QListSelectionManager
QGraphicsListView QListController
Data
InputOutput
QListModelInterfacevs.
QAbstractItemModel
• Optimizable
• Maintainable
• Expandable
Tree Model
List View
Adaptor
QListWidgetNG
QListDefaultModel QListSelectionManager
QGraphicsListView QListController
Graphics View
Item View
int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.show(); return app.exec();}
int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.controller()->setModel(new MyData(&widget)); widget.show(); return app.exec();}
Data and logic Selection state
QGraphicsListView Behavior
• View or Layout?
Item
View
Item
Invisible item
Item
Invisible item
Item
Invisible item
QGraphicsWidget
QGraphicsWidget
QGraphicsWidget
QPropertyAnimation
Position
Opacity
Scale
Rotation
Size
Demo
Me
QGraphicsSimpleTextItem
QGraphicsPixmapItemQGraphicsSvgItem
QGraphicsLayout
Item
Me
View
‘SUP DAWG YO I HERD U LIKE ITEM VIEWS...
ViewView
View
Data and logic Selection state
QGraphicsListView Behavior
Data and logic Selection state
Behavior
Data and logic Selection state
Behavior
Data and logic Selection state
PathListView Behavior
int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget; widget.controller()->setView(new MyPathView); widget.show(); return app.exec();}
Item
View
Item
View
Demo
Data and logic Selection state
Presentation Behavior
Data and logic Selection state
Presentation QListController
Input Events
ControllerModel
Item
View Input Events
Controller
Item
View Scrollbar
Controller
Data and logic Selection state
Presentation QListController
Data and logic Selection state
Presentation
Data and logic Selection state
Presentation
Data and logic Selection state
Presentation QKineticListController
int main(int argc, char *argv[]){ QApplication app(argc, argv); QListWidgetNG widget(new QKineticListController); widget.show(); return app.exec();}
Can I Start Using It?
• Yes
• Yes, but ...
Research!
• Current status
• Integrating in existing applications
• Profiling and optimizing
• Current status
• Missing features
• API may change
• Unsolved problem
• Data Invalidation
“Don’t expect, inspect!”
http://labs.trolltech.com/page/Projects/Itemview/ItemviewsNG
http://qt.gitorious.org/qt-labs/itemviews-ng
Thank you!
Questions?