TODO: merge to qt note.
An Introduction to Design Patterns in C++ with Qt (2nd Edition)
Free download available from Introduction to Design Patterns in C++ with Qt, 2nd Edition | InformIT.
QVariant ObjectBrowserModel::headerData( const int section,
const Qt::Orientation orient,
const int role) const
{
if ( orient != Qt::Horizontal || role != Qt::DisplayRole )
return QAbstractItemModel::headerData( section, orient, role );
switch ( section ) {
case 0: return "Class Name";
case 1: return "Object Name";
case 2: return "Address";
}
return QVariant();
}