summaryrefslogtreecommitdiffstats
path: root/src/plugins/generic/tuiotouch/qtuiotoken_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/generic/tuiotouch/qtuiotoken_p.h')
-rw-r--r--src/plugins/generic/tuiotouch/qtuiotoken_p.h62
1 files changed, 13 insertions, 49 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiotoken_p.h b/src/plugins/generic/tuiotouch/qtuiotoken_p.h
index b784190d53..18f93abb54 100644
--- a/src/plugins/generic/tuiotouch/qtuiotoken_p.h
+++ b/src/plugins/generic/tuiotouch/qtuiotoken_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTUIOOBJECT_P_H
#define QTUIOOBJECT_P_H
@@ -66,7 +30,7 @@ public:
, m_angle(0)
, m_angularVelocity(0)
, m_angularAcceleration(0)
- , m_state(Qt::TouchPointPressed)
+ , m_state(QEventPoint::State::Pressed)
{
}
@@ -77,9 +41,9 @@ public:
void setX(float x)
{
- if (state() == Qt::TouchPointStationary &&
+ if (state() == QEventPoint::State::Stationary &&
!qFuzzyCompare(m_x + 2.0, x + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0
- setState(Qt::TouchPointMoved);
+ setState(QEventPoint::State::Updated);
}
m_x = x;
}
@@ -87,9 +51,9 @@ public:
void setY(float y)
{
- if (state() == Qt::TouchPointStationary &&
+ if (state() == QEventPoint::State::Stationary &&
!qFuzzyCompare(m_y + 2.0, y + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0
- setState(Qt::TouchPointMoved);
+ setState(QEventPoint::State::Updated);
}
m_y = y;
}
@@ -109,9 +73,9 @@ public:
{
if (angle > M_PI)
angle = angle - M_PI * 2.0; // zero is pointing upwards, and is the default; but we want to have negative angles when rotating left
- if (state() == Qt::TouchPointStationary &&
+ if (state() == QEventPoint::State::Stationary &&
!qFuzzyCompare(m_angle + 2.0, angle + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0
- setState(Qt::TouchPointMoved);
+ setState(QEventPoint::State::Updated);
}
m_angle = angle;
}
@@ -122,8 +86,8 @@ public:
float angularAcceleration() const { return m_angularAcceleration; }
void setAngularAcceleration(float angularAcceleration) { m_angularAcceleration = angularAcceleration; }
- void setState(const Qt::TouchPointState &state) { m_state = state; }
- Qt::TouchPointState state() const { return m_state; }
+ void setState(const QEventPoint::State &state) { m_state = state; }
+ QEventPoint::State state() const { return m_state; }
private:
int m_id; // sessionID, temporary object ID
@@ -136,9 +100,9 @@ private:
float m_angle;
float m_angularVelocity;
float m_angularAcceleration;
- Qt::TouchPointState m_state;
+ QEventPoint::State m_state;
};
-Q_DECLARE_TYPEINFO(QTuioToken, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1
+Q_DECLARE_TYPEINFO(QTuioToken, Q_RELOCATABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1
QT_END_NAMESPACE