⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imagelabel.h

📁 一个关于snake算法的VISUAL C++的实现
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -