diff options
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes/testtypes.h')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/testtypes.h | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/testtypes.h b/tests/auto/qml/qqmlvaluetypes/testtypes.h index 78797f06b1..19cfc25d23 100644 --- a/tests/auto/qml/qqmlvaluetypes/testtypes.h +++ b/tests/auto/qml/qqmlvaluetypes/testtypes.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef TESTTYPES_H #define TESTTYPES_H @@ -103,10 +78,10 @@ public: m_font.setCapitalization(QFont::AllLowercase); m_font.setLetterSpacing(QFont::AbsoluteSpacing, 10.2); m_font.setWordSpacing(19.7); - m_color.setRedF(0.2); - m_color.setGreenF(0.88); - m_color.setBlueF(0.6); - m_color.setAlphaF(0.34); + m_color.setRedF(0.2f); + m_color.setGreenF(0.88f); + m_color.setBlueF(0.6f); + m_color.setAlphaF(0.34f); } QPoint m_point; @@ -196,7 +171,7 @@ class MyConstantValueSource : public QObject, public QQmlPropertyValueSource Q_OBJECT Q_INTERFACES(QQmlPropertyValueSource) public: - virtual void setTarget(const QQmlProperty &p) { p.write(3345); } + void setTarget(const QQmlProperty &p) override { p.write(3345); } }; class MyOffsetValueInterceptor : public QObject, public QQmlPropertyValueInterceptor @@ -204,8 +179,8 @@ class MyOffsetValueInterceptor : public QObject, public QQmlPropertyValueInterce Q_OBJECT Q_INTERFACES(QQmlPropertyValueInterceptor) public: - virtual void setTarget(const QQmlProperty &p) { prop = p; } - virtual void write(const QVariant &value) { QQmlPropertyPrivate::write(prop, value.toInt() + 13, QQmlPropertyData::BypassInterceptor); } + void setTarget(const QQmlProperty &p) override { prop = p; } + void write(const QVariant &value) override { QQmlPropertyPrivate::write(prop, value.toInt() + 13, QQmlPropertyData::BypassInterceptor); } private: QQmlProperty prop; @@ -217,8 +192,8 @@ class MyColorInterceptor : public QObject, public QQmlPropertyValueInterceptor Q_OBJECT Q_INTERFACES(QQmlPropertyValueInterceptor) public: - virtual void setTarget(const QQmlProperty &p) { prop = p; } - virtual void write(const QVariant &v) + void setTarget(const QQmlProperty &p) override { prop = p; } + void write(const QVariant &v) override { QColor c = v.value<QColor>(); @@ -238,8 +213,8 @@ class MyFloatSetInterceptor : public QObject, public QQmlPropertyValueIntercepto Q_OBJECT Q_INTERFACES(QQmlPropertyValueInterceptor) public: - virtual void setTarget(const QQmlProperty &p) { prop = p; } - virtual void write(const QVariant &) + void setTarget(const QQmlProperty &p) override { prop = p; } + void write(const QVariant &) override { QQmlPropertyPrivate::write(prop, 0.0f, QQmlPropertyData::BypassInterceptor); } @@ -253,8 +228,8 @@ class MyFloatIgnoreInterceptor : public QObject, public QQmlPropertyValueInterce Q_OBJECT Q_INTERFACES(QQmlPropertyValueInterceptor) public: - virtual void setTarget(const QQmlProperty &) {} - virtual void write(const QVariant &) {} + void setTarget(const QQmlProperty &) override {} + void write(const QVariant &) override {} }; class MyColorObject : public QObject |