I hope someone finds the time to answer my C++ beginner question!

I `designed' a new class around the QPixMap like this:

Qt Code:
  1. class Image : public QPixmap
  2. {
  3. private:
  4. int m_x;
  5. int m_y;
  6. QString m_fileName;
  7.  
  8. public:
  9. Image( const QString &filename, int x, int y );
  10.  
  11. };
To copy to clipboard, switch view to plain text mode 

It only adds some new properties to the class.

Then I wrote another class that contains a list of these classes
Qt Code:
  1. class Map : public QWidget
  2. {
  3. Q_OBJECT
  4.  
  5. private:
  6. QList<Image *> m_imageList;
  7.  
  8. public:
  9. Map( QWidget *parent=0 );
  10. ...
  11. protected:
  12. void paintEvent(QPaintEvent*);
  13.  
  14. };
To copy to clipboard, switch view to plain text mode 

In the paintEvent function I want to draw the Images to the screen but I don't know how to do that How can I use the drawPixmap function to draw the pixmap in the Image class??

This is my (erronous) code to drawthe first image

Qt Code:
  1. void Map::paintEvent(QPaintEvent*)
  2. {
  3. if(m_imageList.count() > 0){
  4. QPainter p( this );
  5. p.save();
  6. p.drawPixmap( 0, 0, m_imageList.first()); <= ERROR
  7. p.restore();
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 

Could I just cast the Image to a Pixmap class? And if so, how?

Thanks in advance.. the inheritance options in C++ still confuse me