From 64eb5f8e1320feb78c56ec0acb7399ee6085770d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 23 Apr 2016 17:24:11 +0200 Subject: Add the PythonModuleGeneration module This can be used by KF5 libraries to generate python 2 and 3 bindings. --- tests/GenerateSipBindings/cpplib.h | 113 +++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 tests/GenerateSipBindings/cpplib.h (limited to 'tests/GenerateSipBindings/cpplib.h') diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h new file mode 100644 index 00000000..f8db75b5 --- /dev/null +++ b/tests/GenerateSipBindings/cpplib.h @@ -0,0 +1,113 @@ + +#pragma once + +#include +#include + +#include + +class FwdDecl; + +class MyObject : public QObject +{ + Q_OBJECT +public: + MyObject(QObject* parent = nullptr); + + enum LocalEnum { + Val1 = 1, + Val2 + }; + Q_DECLARE_FLAGS(LocalEnums, LocalEnum) + + enum { + AnonVal1, + AnonVal2 + }; + + double unnamedParameters(int, double); + + int addThree(int input) const; + QList addThree(QList input) const; + + const QString addThree(const QString& input, const QString& prefix = QStringLiteral("Default")) const; + + int findNeedle(QStringList list, QString needle, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const; + + int qtEnumTest(QFlags flags); + int localEnumTest(QFlags flags); + + int functionParam(std::function fn); + int groups(unsigned int maxCount = std::numeric_limits::max()) const; + + int const_parameters(const int input, QObject* const obj = 0) const; + + int fwdDecl(const FwdDecl& f); + int fwdDeclRef(FwdDecl& f); + +signals: + void publicSlotCalled(); + +Q_SIGNALS: + void privateSlotCalled(); + void protectedSlotCalled(); + +public slots: + void publicSlot1(); + +public Q_SLOTS: + void publicSlot2(); + +protected slots: + void protectedSlot1(); + +protected Q_SLOTS: + void protectedSlot2(); + +private slots: + void privateSlot1(); + +private Q_SLOTS: + void privateSlot2(); +}; + +class NonCopyable +{ +public: + NonCopyable(); + ~NonCopyable(); + +private: + int* const mNum; +}; + + +class NonCopyableByMacro +{ +public: + NonCopyableByMacro(); + +private: + Q_DISABLE_COPY(NonCopyableByMacro) +}; + +class HasPrivateDefaultCtor +{ +public: +private: + HasPrivateDefaultCtor(int param = 0); +}; + +namespace SomeNS { + +class NonCopyableInNS +{ +public: + NonCopyableInNS(); + ~NonCopyableInNS(); + +private: + int* const mNum; +}; + +} -- cgit v1.2.1