www.pudn.com > snake_vc++.rar > ImageLabel.h


#pragma once 
// Qt includes 
#include  
#include  
 
// forward declarations 
class MainWindow; 
 
//!  The ImageLabel is space for loading the image in the gui 
/*! 
 * The ImageLabel is space for loading the image in the gui. It is  
 * inherited from QLabel and so does include all functionality 
 * of the QLabel from Qt. In addition the events when the mouse is pressed  
 * are implemented. The mouse events are used to select an inital region of  
 * interest for the inital snake curve. The ellipse is fitted in the bounding  
 * box 
 * 
 * \param guiParent represents the internal gui parent 
 * \param parent is the parent that is passed on to the QLabel 
 * \param f the Qt::WFlags are described in the Qt Reference Manual (QAssistant) 
 * 
 * \todo make the ellipse selection more sufficient. There would be more exact result if the  
 * curve segments can be selected in a more general way. At least a rotation should be added  
 * when placing the ellipse in the image. 
 */ 
class ImageLabel :	public QLabel 
{ 
	Q_OBJECT 
public: 
	//! constructor of the ImageLabel: Space for Image loading; inherited by QLabel 
	ImageLabel(MainWindow* guiParent, QWidget* parent = 0, Qt::WFlags f = 0); 
	//! destructor 
	virtual ~ImageLabel(void); 
 
protected: 
	//! event triggered when mouse button pressed 
	virtual void mousePressEvent(QMouseEvent* event); 
	//! event triggered when mouse button released 
	virtual void mouseReleaseEvent(QMouseEvent* event); 
 
private: 
	//! pointer to the MainWindow parent 
	MainWindow* m_guiParent; 
 
};