diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/abstract.h')
-rw-r--r-- | sources/shiboken6/tests/libsample/abstract.h | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/sources/shiboken6/tests/libsample/abstract.h b/sources/shiboken6/tests/libsample/abstract.h index 746107c71..4c1b98d90 100644 --- a/sources/shiboken6/tests/libsample/abstract.h +++ b/sources/shiboken6/tests/libsample/abstract.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 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 #ifndef ABSTRACT_H #define ABSTRACT_H @@ -49,6 +24,8 @@ private: PrivValue2 = PrivValue1 + 2 }; public: + LIBMINIMAL_DISABLE_COPY_MOVE(Abstract) + enum PrintFormat { Short, Verbose, @@ -63,26 +40,26 @@ public: }; static const int staticPrimitiveField; - int primitiveField; + int primitiveField = 123; Complex userPrimitiveField; - Point valueTypeField; - ObjectType* objectTypeField; - int toBeRenamedField; - int readOnlyField; + Point valueTypeField{12, 34}; + ObjectType *objectTypeField = nullptr; + int toBeRenamedField = 123; + int readOnlyField = 123; - Abstract(int id = -1); + explicit Abstract(int id = -1) noexcept; virtual ~Abstract(); - inline int id() { return m_id; } + inline int id() const { return m_id; } // factory method - inline static Abstract* createObject() { return nullptr; } + inline static Abstract *createObject() { return nullptr; } // method that receives an Object Type - inline static int getObjectId(Abstract* obj) { return obj->id(); } + inline static int getObjectId(Abstract *obj) { return obj->id(); } virtual void pureVirtual() = 0; - virtual void* pureVirtualReturningVoidPtr() = 0; + virtual void *pureVirtualReturningVoidPtr() = 0; virtual void unpureVirtual(); virtual PrintFormat returnAnEnum() = 0; @@ -92,13 +69,16 @@ public: void callPureVirtual(); void callUnpureVirtual(); - void show(PrintFormat format = Verbose); + void show(PrintFormat format = Verbose) const; virtual Type type() const { return TpAbstract; } - virtual void hideFunction(HideType* arg) = 0; + virtual void hideFunction(HideType *arg) = 0; + + virtual void virtualWithOutParameter(int &x) const; + int callVirtualWithOutParameter() const; protected: - virtual const char* className() { return "Abstract"; } + virtual const char *className() const { return "Abstract"; } // Protected bit-field structure member. unsigned int bitField: 1; @@ -107,4 +87,5 @@ private: virtual void pureVirtualPrivate() = 0; int m_id; }; + #endif // ABSTRACT_H |