23.6.  Star Delegates

[ fromfile: homework/stardelegate.xml id: stardelegate ]

  1. In the Qt examples, there is a stardelegate app that provides a QItemDelegate for StarRating instances.

  2. Instead of using a word like "bad" or "great" to rate a song, you can give the song from zero to N stars that are displayed in the tabular output instead of or in addition to the Preference.

  3. Write a class or namespace that provides a bidirectional conversion between Preference and StarRating.

  4. Write a StarDelegate that works for Preference.