diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-06 10:55:34 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-06 10:55:34 +0200 |
| commit | 0e3a58441644faa14698a44f2ed682150430529a (patch) | |
| tree | de19c693a802abf6f020867f6ca8e912b0d019c6 /sources/pyside2/tests | |
| parent | 82934bc00c2de7ea51fd7e95601472fcdf7b6aea (diff) | |
| parent | b57f329ecbf1fd0b29ae0e8284c885adc0eb4ed3 (diff) | |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I7b4ff138799ee81940c36e68a105cb42bb38a3ff
Diffstat (limited to 'sources/pyside2/tests')
| -rw-r--r-- | sources/pyside2/tests/pysidetest/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/hiddenobject.h | 11 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/pysidetest_global.h | 9 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/pysidetest_macros.h | 43 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/testobject.cpp | 2 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/testobject.h | 33 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/testview.h | 10 |
7 files changed, 80 insertions, 32 deletions
diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index 2f7633e9a..972793519 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -65,6 +65,7 @@ endif() make_path(testbinding_include_dirs ${pyside2_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../../../shiboken2/libshiboken ${CMAKE_CURRENT_SOURCE_DIR}/../../PySide2 ${CMAKE_CURRENT_SOURCE_DIR}/../../libpyside ${QT_INCLUDE_DIR} @@ -103,6 +104,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${libpyside_SOURCE_DIR}) add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC}) +set_target_properties(pysidetest PROPERTIES + DEFINE_SYMBOL BUILD_PYSIDETEST) + target_link_libraries(pysidetest Shiboken2::libshiboken ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES} diff --git a/sources/pyside2/tests/pysidetest/hiddenobject.h b/sources/pyside2/tests/pysidetest/hiddenobject.h index ffa8d614a..97a2864c5 100644 --- a/sources/pyside2/tests/pysidetest/hiddenobject.h +++ b/sources/pyside2/tests/pysidetest/hiddenobject.h @@ -29,11 +29,9 @@ #ifndef HIDDENOBJECT_H #define HIDDENOBJECT_H -#ifdef pysidetest_EXPORTS -#define PYSIDE_EXPORTS 1 -#endif -#include "pysidemacros.h" -#include <QObject> +#include "pysidetest_macros.h" + +#include <QtCore/QObject> // This class shouldn't be exported! class HiddenObject : public QObject @@ -49,7 +47,6 @@ private: }; // Return a instance of HiddenObject -PYSIDE_API QObject* getHiddenObject(); - +PYSIDETEST_API QObject* getHiddenObject(); #endif diff --git a/sources/pyside2/tests/pysidetest/pysidetest_global.h b/sources/pyside2/tests/pysidetest/pysidetest_global.h index 0077ade96..f65662cb5 100644 --- a/sources/pyside2/tests/pysidetest/pysidetest_global.h +++ b/sources/pyside2/tests/pysidetest/pysidetest_global.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of Qt for Python. @@ -26,9 +26,12 @@ ** ****************************************************************************/ +#ifndef PYSIDETEST_GLOBAL_H +#define PYSIDETEST_GLOBAL_H + // PySide global.h file -#include "pyside2_global.h" #include "testobject.h" #include "testview.h" -#define PYSIDE_API #include "hiddenobject.h" + +#endif // PYSIDETEST_GLOBAL_H diff --git a/sources/pyside2/tests/pysidetest/pysidetest_macros.h b/sources/pyside2/tests/pysidetest/pysidetest_macros.h new file mode 100644 index 000000000..b561efbbc --- /dev/null +++ b/sources/pyside2/tests/pysidetest/pysidetest_macros.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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$ +** +****************************************************************************/ + +#ifndef PYSIDETEST_MACROS_H +#define PYSIDETEST_MACROS_H + +#include <pysidemacros.h> + +#define PYSIDETEST_EXPORT PYSIDE_EXPORT +#define PYSIDETEST_IMPORT PYSIDE_IMPORT + +#ifdef BUILD_PYSIDETEST +# define PYSIDETEST_API PYSIDETEST_EXPORT +#else +# define PYSIDETEST_API PYSIDETEST_IMPORT +#endif + +#endif // PYSIDETEST_MACROS_H diff --git a/sources/pyside2/tests/pysidetest/testobject.cpp b/sources/pyside2/tests/pysidetest/testobject.cpp index 441ae872f..43fa93bac 100644 --- a/sources/pyside2/tests/pysidetest/testobject.cpp +++ b/sources/pyside2/tests/pysidetest/testobject.cpp @@ -28,6 +28,8 @@ #include "testobject.h" +#include <QtCore/QDebug> + void TestObject::emitIdValueSignal() { emit idValue(m_idValue); diff --git a/sources/pyside2/tests/pysidetest/testobject.h b/sources/pyside2/tests/pysidetest/testobject.h index f8a174d46..41a97a0db 100644 --- a/sources/pyside2/tests/pysidetest/testobject.h +++ b/sources/pyside2/tests/pysidetest/testobject.h @@ -29,15 +29,15 @@ #ifndef TESTOBJECT_H #define TESTOBJECT_H -#include <QObject> -#include <QApplication> -#include <QMetaType> -#include <QVariant> -#include <QDebug> -#ifdef pysidetest_EXPORTS -#define PYSIDE_EXPORTS 1 -#endif -#include "pysidemacros.h" +#include "pysidetest_macros.h" + +#include <QtWidgets/QApplication> + +#include <QtCore/QObject> +#include <QtCore/QMetaType> +#include <QtCore/QVariant> + +QT_FORWARD_DECLARE_CLASS(QDebug) class IntValue { @@ -50,7 +50,7 @@ public: typedef IntValue TypedefValue; -class PYSIDE_API TestObject : public QObject +class PYSIDETEST_API TestObject : public QObject { Q_OBJECT public: @@ -82,15 +82,15 @@ private: int m_idValue; QList<QObject*> m_children; }; -PYSIDE_API QDebug operator<<(QDebug dbg, TestObject &testObject); +PYSIDETEST_API QDebug operator<<(QDebug dbg, TestObject &testObject); typedef int PySideInt; namespace PySideCPP { -class PYSIDE_API TestObjectWithNamespace : public QObject +class PYSIDETEST_API TestObjectWithNamespace : public QObject { Q_OBJECT public: @@ -106,17 +106,18 @@ signals: void emitSignalWithNamespace(PySideCPP::TestObjectWithNamespace* obj); void emitSignalWithTypedef(PySideInt val); }; -PYSIDE_API QDebug operator<<(QDebug dbg, TestObjectWithNamespace &testObject); -class PYSIDE_API TestObject2WithNamespace : public QObject +PYSIDETEST_API QDebug operator<<(QDebug dbg, TestObjectWithNamespace &testObject); + +class PYSIDETEST_API TestObject2WithNamespace : public QObject { Q_OBJECT public: TestObject2WithNamespace(QObject* parent) : QObject(parent) {} QString name() { return "TestObject2WithNamespace"; } }; -PYSIDE_API QDebug operator<<(QDebug dbg, TestObject2WithNamespace& testObject); +PYSIDETEST_API QDebug operator<<(QDebug dbg, TestObject2WithNamespace& testObject); } // Namespace PySideCPP @@ -127,7 +128,7 @@ enum Enum1 { Option1 = 1, Option2 = 2 }; typedef long PySideLong; -class PYSIDE_API TestObjectWithoutNamespace : public QObject +class PYSIDETEST_API TestObjectWithoutNamespace : public QObject { Q_OBJECT public: diff --git a/sources/pyside2/tests/pysidetest/testview.h b/sources/pyside2/tests/pysidetest/testview.h index 66d0a94d9..b80a7fca9 100644 --- a/sources/pyside2/tests/pysidetest/testview.h +++ b/sources/pyside2/tests/pysidetest/testview.h @@ -29,11 +29,9 @@ #ifndef TESTVIEW_H #define TESTVIEW_H -#include <QObject> -#ifdef pysidetest_EXPORTS -#define PYSIDE_EXPORTS 1 -#endif -#include "pysidemacros.h" +#include "pysidetest_macros.h" + +#include <QtCore/QObject> QT_BEGIN_NAMESPACE class QWidget; @@ -41,7 +39,7 @@ class QAbstractListModel; class QAbstractItemDelegate; QT_END_NAMESPACE -class PYSIDE_API TestView : public QObject +class PYSIDETEST_API TestView : public QObject { Q_OBJECT public: |
