"Boiler
Plate" QTreeView subclass with hooks for custom drawing and editing
Bake 0 -- RiverWare 6.1 -- Qt 4.6.3 -- Phil Weinstein -- 1-13-2011
// BoilerTreeView.cpp
//
// CLASSES:
// class BoilerTreeView :
public QTreeView
// class BoilerTreeView::ItemModel : public QAbstractItemModel
// class BoilerTreeView::ItemDelegate : public QStyledItemDelegate
//
// DESCRIPTION:
// This boiler plate Qt4 QTreeView class with internal "model" and
// "delegate" subclasses is intended for adaptation for application
// QTreeView classes. It is concrete (i.e. it can be instantiated), and
// -- as coded -- implements a three-column, five-row unsortable list
// with the cells in the middle column being editable.
//
// If column sorting is desired, I recommend handling sorting directly
// in the item model class rather than by introducing a QSortFilterProxyModel
// subclass. Use of that class creates ambiguities in interpreting
// QModelIndex values, and itself has some problems. However, if you
// really want to use a QSortFilterProxyModel, I recommend use of our
// own "RwQSortFilterProxyModel" to fix those problems. (At least
see
// the comments at the head of RwQSortFilterProxyModel.cpp).
//
// To use as a basis for a new QTreeView subclass, copy this file, and the
// the accompanying header file, and do a global substitution within the
// new files of "Boiler".
//
// (1) BoilerTreeView.cpp
// (2) BoilerTreeView.hpp
//
// All three classes are "QObjects", so need to be handled as such
in
// make files -- On Windows: in the two ".pro" files.
//
//--