greenhouse/src/RectItem.h
matlabbe b3bed3759b added Feature2D/MaxFeatures parameter
On graphicsView mode, if a homography rectangle is selected, the corresponding object in the objects pane is selected

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@271 620bd6b2-0a58-f614-fd9a-1bd335dccda9
2014-05-13 17:47:59 +00:00

44 lines
950 B
C++

/*
* Copyright (C) 2011, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
*/
#ifndef RECTITEM_H_
#define RECTITEM_H_
#include <QtGui/QGraphicsRectItem>
#include <QtGui/QGraphicsTextItem>
#include <QtGui/QPen>
#include <QtGui/QBrush>
class RectItem : public QObject, public QGraphicsRectItem
{
Q_OBJECT;
public:
RectItem(int id, const QRectF &rect, QGraphicsItem * parent = 0);
virtual ~RectItem();
void setColor(const QColor & color);
int id() const {return id_;}
signals:
void hovered(int);
protected:
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
virtual void focusInEvent ( QFocusEvent * event );
virtual void focusOutEvent ( QFocusEvent * event );
private:
void showDescription();
void hideDescription();
private:
QGraphicsRectItem * placeHolder_;
int id_;
};
#endif /* RECTITEM_H_ */