is there a complete explanation somewhere for how to use QDataWidgetMapper ?

i am trying to learn to use it by using examples from qt and can not figure it out. i am trying to do this in creator. is there an order that it must be listed?

this code
mapper = new QDataWidgetMapper(this);
causes error
invalid use of undefined type 'struct QDataWidgetMapper' in my.cpp

in my.h
class QDataWidgetMapper;

in class def
QDataWidgetMapper *mapper;

help....