imagelabel.h

来自「一个关于snake算法的VISUAL C++的实现」· C头文件 代码 · 共 46 行

H
46
字号
#pragma once
// Qt includes
#include <QtCore/QObject>
#include <QtGui/QLabel>

// 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;

};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?