On Monday 27 September 2004 16:59, Prabu Subroto wrote:
Stefan, I think I should try subclassing a QLabel from QDataTable. But I don't know how I should do that.
???
Neither do I. That would neither make sense nor would it work.
What you need to do is to subclass your own widget class from QDataTable and
make the setPixmap() method publicly available - like this:
MyDataTable: public QDataTable
{
Q_OBJECT
MyDataTable( QWidget * parent = 0, const char * name = 0 )
: QDataTable( parent, name ) // call parent class constructor
{} // nothing more to do here
virtual ~MyDataTable() {} // empty virtual destructor (you want that!)
// this is what we need this class for in the first place:
// make this method public
setPixmap( int row, int col, const QPixmap & pix )
{ QTable::setPixmap( row, col, pix ); }
}
That's it. Now you can setPixmap() from the outside.
CU
--
Stefan Hundhammer