You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.1 KiB
61 lines
1.1 KiB
14 years ago
|
|
||
|
#ifndef UBMAGNIFER_H
|
||
|
#define UBMAGNIFER_H
|
||
|
|
||
|
#include <QWidget>
|
||
|
#include <QBitmap>
|
||
|
#include <QPen>
|
||
|
|
||
|
class QPixmap;
|
||
|
class QBitmap;
|
||
|
class QPen;
|
||
|
class QGraphicsView;
|
||
|
|
||
|
class UBMagnifer : public QWidget
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
UBMagnifer(QWidget *parent = 0);
|
||
|
~UBMagnifer();
|
||
|
|
||
|
void setSize(int percentFromScene);
|
||
|
void setZoom(int z);
|
||
|
|
||
|
void setGrabView(QGraphicsView *view);
|
||
|
void setMoveView(QGraphicsView *view) {mView = view;}
|
||
|
|
||
|
void grabPoint(const QPoint &point);
|
||
|
void grabPoint(const QPointF &point);
|
||
|
void grabNMove(const QPoint &point, bool needGrab);
|
||
|
void grabNMove(const QPointF &point, bool needGrab);
|
||
|
|
||
|
protected:
|
||
|
void paintEvent(QPaintEvent *);
|
||
|
void timerEvent(QTimerEvent *);
|
||
|
|
||
|
int sizePercentFromScene;
|
||
|
|
||
|
|
||
|
private:
|
||
|
int zoom;
|
||
|
int zWidth;
|
||
|
int zHeight;
|
||
|
int zWidthHalf;
|
||
|
int zHeightHalf;
|
||
|
bool inTimer;
|
||
|
|
||
|
int timerUpdate;
|
||
|
QPoint updPoint;
|
||
|
QPointF updPointF;
|
||
|
|
||
|
QPixmap pMap;
|
||
|
QBitmap bmpMask;
|
||
|
QPen borderPen;
|
||
|
|
||
|
QGraphicsView *gView;
|
||
|
QGraphicsView *mView;
|
||
|
};
|
||
|
|
||
|
#endif // UBMAGNIFER_H
|