aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/virtualmethods.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/virtualmethods.h')
-rw-r--r--sources/shiboken6/tests/libsample/virtualmethods.h71
1 files changed, 24 insertions, 47 deletions
diff --git a/sources/shiboken6/tests/libsample/virtualmethods.h b/sources/shiboken6/tests/libsample/virtualmethods.h
index 577f6919e..b7172ad0d 100644
--- a/sources/shiboken6/tests/libsample/virtualmethods.h
+++ b/sources/shiboken6/tests/libsample/virtualmethods.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 VIRTUALMETHODS_H
#define VIRTUALMETHODS_H
@@ -42,11 +17,10 @@
class LIBSAMPLE_API VirtualMethods
{
public:
- VirtualMethods(Str name = "VirtualMethods") : m_name(name)
- {
- m_left = m_top = m_right = m_bottom = 0;
- }
- virtual ~VirtualMethods() {}
+ LIBMINIMAL_DEFAULT_COPY_MOVE(VirtualMethods)
+
+ explicit VirtualMethods(Str name = "VirtualMethods") : m_name(name) {}
+ virtual ~VirtualMethods() = default;
virtual double virtualMethod0(Point pt, int val, Complex cpx, bool b);
double callVirtualMethod0(Point pt, int val, Complex cpx, bool b)
@@ -86,12 +60,14 @@ public:
void callCallMe() { callMe(); }
// Passing reference to pointers.
- virtual bool createStr(const char* text, Str*& ret);
- bool callCreateStr(const char* text, Str*& ret) { return createStr(text, ret); }
+ virtual bool createStr(const char *text, Str *&ret);
+ bool callCreateStr(const char *text, Str *&ret) { return createStr(text, ret); }
// Return a non-binded method
- std::list<Str> callStrListToStdList(const StrList& strList) { return strListToStdList(strList); }
- virtual std::list<Str> strListToStdList(const StrList& strList ) { return strList; }
+ std::list<Str> callStrListToStdList(const StrList &strList)
+ { return strListToStdList(strList); }
+ virtual std::list<Str> strListToStdList(const StrList &strList )
+ { return strList; }
void setMargins(int left, int top, int right, int bottom)
{
@@ -100,16 +76,16 @@ public:
m_right = right;
m_bottom = bottom;
}
- virtual void getMargins(int* left, int* top, int* right, int* bottom) const;
- void callGetMargins(int* left, int* top, int* right, int* bottom) const
+ virtual void getMargins(int *left, int *top, int *right, int *bottom) const;
+ void callGetMargins(int *left, int *top, int *right, int *bottom) const
{
getMargins(left, top, right, bottom);
}
- virtual int recursionOnModifiedVirtual(Str arg) const { return 0; }
+ virtual int recursionOnModifiedVirtual(Str arg) const;
int callRecursionOnModifiedVirtual(Str arg) const { return recursionOnModifiedVirtual(arg); }
- virtual const Str & returnConstRef() const;
+ virtual const Str &returnConstRef() const;
virtual int stringViewLength(std::string_view in) const;
@@ -119,10 +95,10 @@ protected:
private:
Str m_name;
- int m_left;
- int m_top;
- int m_right;
- int m_bottom;
+ int m_left = 0;
+ int m_top = 0;
+ int m_right = 0;
+ int m_bottom = 0;
};
class LIBSAMPLE_API VirtualDaughter : public VirtualMethods
@@ -153,10 +129,12 @@ public:
class LIBSAMPLE_API VirtualDtor
{
public:
- VirtualDtor() {}
+ LIBMINIMAL_DEFAULT_COPY_MOVE(VirtualDtor)
+
+ VirtualDtor() noexcept = default;
virtual ~VirtualDtor() { dtor_called++; }
- static VirtualDtor* create() { return new VirtualDtor(); }
+ static VirtualDtor *create() { return new VirtualDtor(); }
static int dtorCalled() { return dtor_called; }
static void resetDtorCounter() { dtor_called = 0; }
@@ -165,4 +143,3 @@ private:
};
#endif // VIRTUALMETHODS_H
-