mancatux/src/gui/Hole.h

34 lines
513 B
C
Raw Normal View History

2007-10-15 21:32:30 +02:00
#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