This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
TrackerPlugin_EyeTracker/ResizeHelper.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (33 sloc)
1.05 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ResizeHelper_H | |
#define ResizeHelper_H | |
#include <QObject> | |
#include <QGraphicsObject> | |
#include <QPen> | |
#include <QPainter> | |
#include <QGraphicsScene> | |
#include <QGraphicsSceneMouseEvent> | |
#include <ResizeTraits.h> | |
#include <QDebug> | |
class ResizeHelper : public QGraphicsObject | |
{ | |
Q_OBJECT | |
public: | |
QRectF boundsRect; /*Defines the bounding area in which object can be moved/resized*/ | |
ResizeHelper(QObject *parent = 0); | |
private: | |
ResizeTraits traits; | |
QRectF rubberRect; | |
QPen rubberPen; | |
QFlags<Qt::Edge> rubberEdges; | |
QPointF clickPos; /*Last position used to detect movement*/ | |
QRectF boundingRect() const Q_DECL_OVERRIDE; | |
void newGeometry(); /*Propagate geometry change to bounding rectangle*/ | |
void paint(QPainter * p, const QStyleOptionGraphicsItem *, QWidget *); | |
void mousePressEvent(QGraphicsSceneMouseEvent * ev) Q_DECL_OVERRIDE; | |
void mouseMoveEvent(QGraphicsSceneMouseEvent * ev) Q_DECL_OVERRIDE; | |
signals: | |
void itemChanged(QGraphicsItem* item); | |
public slots: | |
void selectionChanged(); | |
}; | |
#endif // ResizeHelper_H |