first commit
This commit is contained in:
63
project/fm_viewer/ui/fm_drag_zoom_widget.h
Normal file
63
project/fm_viewer/ui/fm_drag_zoom_widget.h
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
#ifndef FM_DRAG_ZOOM_WIDGET_H
|
||||
#define FM_DRAG_ZOOM_WIDGET_H
|
||||
#if (USE_DRAG_ZOOM)
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
class FMDragZoomWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
#if (DRAG_ZOOM_BY_RATIO)
|
||||
QSize ratio;
|
||||
#endif //
|
||||
|
||||
private:
|
||||
|
||||
bool _mousePressed;
|
||||
bool _drawStarted;
|
||||
bool _ROIEnabled;
|
||||
|
||||
|
||||
QCursor* _magnify;
|
||||
QPixmap _pixmap;
|
||||
QRect _rect;
|
||||
QPainter _painter;
|
||||
|
||||
QPoint filterPoint(QPoint point);
|
||||
void sendSelectedSignal();
|
||||
public:
|
||||
|
||||
#if (USE_DRAG_ZOOM)
|
||||
bool _disabled;
|
||||
bool _block;
|
||||
#endif // USE_DRAG_ZOOM
|
||||
|
||||
explicit FMDragZoomWidget(QWidget *parent = 0);
|
||||
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
void mouseReleaseEvent(QMouseEvent *e);
|
||||
void mouseDoubleClickEvent(QMouseEvent *e);
|
||||
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
void setROIEnabled(bool enabled);
|
||||
void ROIReset(); // fullscreen
|
||||
|
||||
public slots:
|
||||
#if (USE_DRAG_ZOOM)
|
||||
void onReleaseDisabled();
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void ROISelected(double x, double y, double width, double height);
|
||||
void ROICleared();
|
||||
#if (CLICK_PAUSE_PLAY)
|
||||
void clicked(); ///! DRAG 없이 CLICK 발생?
|
||||
#endif // CLICK_PAUSE_PLAY
|
||||
public slots:
|
||||
};
|
||||
#endif // #if (USE_DRAG_ZOOM)
|
||||
#endif // FM_DRAG_ZOOM_WIDGET_H
|
||||
Reference in New Issue
Block a user