#ifndef IMGWIDGET_H
#define IMGWIDGET_H

#include <qimage.h>
#include <qpixmap.h>
#include <qwidget.h>
#include <qpaintdevice.h>

class ImgWidget : public QWidget
{
	Q_OBJECT
	
	public:
	
		ImgWidget (QWidget* parent = 0, const char* name = 0);
		
	public:
	
		bool loadImage(const QString& fname);
		
		// subdivide(), etc.
		
	public slots:
	
		/* 
		 * This is the important function to override that makes
		 * our ImgWidget behave like a widget.
		 */
		void paintEvent(QPaintEvent *pEv);
		
		// You can also override mousePressEvent(), etc. 
		// See the QWidget documentation
		
	private:
		
		QImage* pixels;
		QPixmap* pmbuf;
};

#endif

