This application has a "central widget" that should display the current playlist. Sometimes it will be a view of a PlayList, but other times, it will show us the contents of a Database. One approach, shown in Figure 25.8 is to make both classes multiply-inherit from QAbstractTableModel, so they can both be viewed in a QTableView.
To model a collection of DataObjects as a table, you can reuse DataObjectTableModel. This class determines what to display in each column based on Qt properties. This makes PlayListView much easier to write.
Write a PlayListView class. You do not need to write any code for databases, but keep the design considerations of Figure 25.8 in mind as you write it.
Enhance the GUI you wrote in Section 25.8, by adding a load playlist button. Add a QAction-derived class called LoadPlayListAction. Write the action so that it fills up the contents of the PlayListView.
Make the Mp3Player work so that it can automatically play one song after another in the loaded playlist.
Part I: Introduction to C++ and Qt 4
C++ Introduction
Classes
Introduction to Qt
Lists
Functions
Inheritance and Polymorphism
Part II: Higher-Level Programming
Libraries
Introduction to Design Patterns
QObject
Generics and Containers
Qt GUI Widgets
Concurrency
Validation and Regular Expressions
Parsing XML
Meta Objects, Properties, and Reflective Programming
More Design Patterns
Models and Views
Qt SQL Classes
Part III: C++ Language Reference
Types and Expressions
Scope and Storage Class
Statements and Control Structures
Memory Access
Chapter Summary
Inheritance in Detail
Miscellaneous Topics
Part IV: Programming Assignments
MP3 Jukebox Assignments
Part V: Appendices
MP3 Jukebox Assignments
Bibliography
MP3 Jukebox Assignments