2017-09-27 13:04:56 +03:00
|
|
|
#ifndef LRGRAPHICSVIEWZOOM_H
|
|
|
|
#define LRGRAPHICSVIEWZOOM_H
|
2016-03-30 23:02:35 +03:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QGraphicsView>
|
|
|
|
|
|
|
|
namespace LimeReport {
|
|
|
|
|
|
|
|
class GraphicsViewZoomer : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
GraphicsViewZoomer(QGraphicsView* view);
|
|
|
|
void gentleZoom(double factor);
|
|
|
|
void setModifiers(Qt::KeyboardModifiers modifiers);
|
|
|
|
void setZoomFactorBase(double value);
|
2016-06-10 18:05:18 +03:00
|
|
|
void setView(QGraphicsView* view);
|
2016-03-30 23:02:35 +03:00
|
|
|
private:
|
|
|
|
QGraphicsView* m_view;
|
|
|
|
Qt::KeyboardModifiers m_modifiers;
|
|
|
|
double m_zoomFactorBase;
|
|
|
|
QPointF m_targetScenePos, m_targetViewportPos;
|
|
|
|
bool eventFilter(QObject* object, QEvent* event);
|
|
|
|
signals:
|
2016-04-05 23:06:11 +03:00
|
|
|
void zoomed(double factor);
|
2016-03-30 23:02:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace LimeReport
|
|
|
|
|
|
|
|
#endif // GRAPHICSVIEWZOOM_H
|