k-observer/K-observer_client_qt/CustomButton.h
2013-01-19 21:55:39 +00:00

38 lines
641 B
C++

#ifndef CUSTOMBUTTON_H
#define CUSTOMBUTTON_H
#include <QtGui/QtGui>
#include "observerclientmodel.h"
class TCustomButton : public QPushButton
{
Q_OBJECT
public:
explicit TCustomButton(QWidget *parent=0)
: QPushButton(parent)
{
}
explicit TCustomButton(const QString &text, QWidget *parent=0)
: QPushButton(text, parent)
{
}
boost::function<void()> PressedHandler;
protected:
virtual void mouseReleaseEvent ( QMouseEvent * e )
{
QAbstractButton::mouseReleaseEvent(e);
PressedHandler();
}
};
#endif // CUSTOMBUTTON_H