34 lines
513 B
C
34 lines
513 B
C
|
#ifndef _HOLE_H_
|
||
|
#define _HOLE_H_
|
||
|
|
||
|
#include <QMouseEvent>
|
||
|
|
||
|
#include "ClickLabel.h"
|
||
|
|
||
|
|
||
|
|
||
|
class Hole : public ClickLabel
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
Hole ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
|
||
|
: ClickLabel ( parent, f ), id_( 0 ) { }
|
||
|
|
||
|
void setId ( int id ) { id_ = id; }
|
||
|
|
||
|
signals:
|
||
|
void clicked ( int id );
|
||
|
|
||
|
private:
|
||
|
int id_;
|
||
|
|
||
|
void mousePressEvent ( QMouseEvent * event )
|
||
|
{
|
||
|
if ( event->button() == Qt::LeftButton )
|
||
|
emit clicked( id_ );
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif
|