diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/abstract.cpp')
-rw-r--r-- | sources/shiboken6/tests/libsample/abstract.cpp | 100 |
1 files changed, 37 insertions, 63 deletions
diff --git a/sources/shiboken6/tests/libsample/abstract.cpp b/sources/shiboken6/tests/libsample/abstract.cpp index 3b2b1ef0a..0d67d8630 100644 --- a/sources/shiboken6/tests/libsample/abstract.cpp +++ b/sources/shiboken6/tests/libsample/abstract.cpp @@ -1,89 +1,64 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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 WITH Qt-GPL-exception-1.0 -#include <iostream> #include "abstract.h" -#include "objecttype.h" -using namespace std; +#include <iostream> const int Abstract::staticPrimitiveField = 0; -Abstract::Abstract(int id) : m_id(id) +Abstract::Abstract(int id) noexcept : m_id(id) { - toBeRenamedField = readOnlyField = primitiveField = 123; - valueTypeField = Point(12, 34); - objectTypeField = nullptr; bitField = 0; } -Abstract::~Abstract() -{ -} +Abstract::~Abstract() = default; -void -Abstract::unpureVirtual() +void Abstract::unpureVirtual() { } -void -Abstract::callUnpureVirtual() +void Abstract::callUnpureVirtual() { this->unpureVirtual(); } - -void -Abstract::callPureVirtual() +void Abstract::callPureVirtual() { this->pureVirtual(); } -void -Abstract::show(PrintFormat format) +void Abstract::show(PrintFormat format) const { - cout << '<'; + std::cout << '<'; switch(format) { - case Short: - cout << this; - break; - case Verbose: - cout << "class " << className() << " | cptr: " << this; - cout << ", id: " << m_id; - break; - case OnlyId: - cout << "id: " << m_id; - break; - case ClassNameAndId: - cout << className() << " - id: " << m_id; - break; + case Short: + std::cout << this; + break; + case Verbose: + std::cout << "class " << className() << " | cptr: " << this + << ", id: " << m_id; + break; + case OnlyId: + std::cout << "id: " << m_id; + break; + case ClassNameAndId: + std::cout << className() << " - id: " << m_id; + break; } - cout << '>'; + std::cout << '>'; +} + +void Abstract::virtualWithOutParameter(int &x) const +{ + x = 42; +} + +int Abstract::callVirtualWithOutParameter() const +{ + int x; + virtualWithOutParameter(x); + return x; } void Abstract::callVirtualGettingEnum(PrintFormat p) @@ -91,7 +66,6 @@ void Abstract::callVirtualGettingEnum(PrintFormat p) virtualGettingAEnum(p); } -void Abstract::virtualGettingAEnum(Abstract::PrintFormat p) +void Abstract::virtualGettingAEnum(Abstract::PrintFormat) { } - |