diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-26 16:33:13 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-27 10:42:54 +0000 |
commit | 0e1f83dcade8cb6428513eea4452dcd500f9e486 (patch) | |
tree | 227c4848145b23fde12ad33d3bea3a60c04cb36e /src/quick/handlers/qquickpinchhandler.cpp | |
parent | 447e2e024609a22fe052cf458c27efdef2e3d3eb (diff) |
Fix PointerHandler constructors and destructors
- Constructors should take QQuickItem* not QObject* to be symmetric
with the parentItem() accessor (and other code) which assumes its type
- Use header initialization everywhere possible
- Reorder variables to minimize padding (somewhat)
- Remove empty destructor bodies (the compiler can write them)
- Remove override and virtual from destructors in accordance with
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override
Change-Id: I682a53a803d65e29136bfaec3a5b534e975ecf30
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpinchhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index d6e1a183bb..75a2847aa0 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -85,27 +85,8 @@ Q_LOGGING_CATEGORY(lcPinchHandler, "qt.quick.handler.pinch") \sa PinchArea */ -QQuickPinchHandler::QQuickPinchHandler(QObject *parent) +QQuickPinchHandler::QQuickPinchHandler(QQuickItem *parent) : QQuickMultiPointHandler(parent, 2) - , m_activeScale(1) - , m_accumulatedScale(1) - , m_activeRotation(0) - , m_activeTranslation(0,0) - , m_minimumScale(-qInf()) - , m_maximumScale(qInf()) - , m_minimumRotation(-qInf()) - , m_maximumRotation(qInf()) - , m_minimumX(-qInf()) - , m_maximumX(qInf()) - , m_minimumY(-qInf()) - , m_maximumY(qInf()) - , m_pinchOrigin(PinchCenter) - , m_startScale(1) - , m_startRotation(0) -{ -} - -QQuickPinchHandler::~QQuickPinchHandler() { } |