Next generation Qt item views :o

28 minutes of video presentation

http://developer.qt.nokia.com/elearning/watch/the_next_generation_qt_item_views

For those who followed some of my tutorials in PyQt should know that Qt utilizes an abstract model interface to act as an adaptor between the data and the view. There is no controller. The Model-View framework in Qt is a simplified, modified version of the actual Model-View-Controller pattern :slight_smile:

But watching that video, Qt gets some more love in this area :slight_smile:

So instead of using QAbstractItemModel and QAbstractItemView ( appliable to List, Table, Tree)
they introduce dedicated interfaces for each separate data storage model, and also a Controller :slight_smile: so it’s MVC now

For list:
QListModelInterface (Data and logc)
QGraphicsListView (Presentation, GraphicsView is hardware accelerated)
QListController (Behaviour and input)
QListSelectionManager (Selection state)

And if you would want to use the old QListWidget (no model view based), the new way would be using this:
QListWidgetNG (next generation) that has an instance of controller, where the controller has instance of view and model behind the scenes :slight_smile:

All the items are QGraphicsViews aswell, so you can have ITEMS which are themselves QGraphicsListViews :slight_smile:

Animations are alot easier to handle etc :slight_smile:
Since the controller is responsible for input and then doing something on the View and the Model, this allows stuff such as QKineticListController provided, where scrolling and dragging is kind of velocity preserving when you release the inputs. So you can now controll your applicaiton even more by subclassing Controllers.

Qt is also getting optimized as hell, right now a view loads all the model data into memory instead of asking for the 10 items your view can show… this is being looked at and optimized away :slight_smile: So it will not load 10 000 data from the list model etc :slight_smile:

They also have an Adaptor interface now that allows you to convert a tree models output data into a list, so a listview can view tree model data if desired.

So many reasons to love Qt outside of UI programming :slight_smile:

Check out the sidebar on that developer network link for more juicy stuff :slight_smile:

Best regards!

Thanks for the update Yasin, this is great news.