diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-04-23 17:24:11 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-31 15:38:08 +0000 |
commit | 64eb5f8e1320feb78c56ec0acb7399ee6085770d (patch) | |
tree | 6ced89f400b6f4208fb5ad2fbd8501a20f1751bd /tests/GenerateSipBindings/cpplib.h | |
parent | e052fc95db845a5e0f0b450c8fbffb35f0bbc638 (diff) | |
download | extra-cmake-modules-64eb5f8e1320feb78c56ec0acb7399ee6085770d.tar.gz extra-cmake-modules-64eb5f8e1320feb78c56ec0acb7399ee6085770d.tar.bz2 |
Add the PythonModuleGeneration module
This can be used by KF5 libraries to generate python 2 and 3 bindings.
Diffstat (limited to 'tests/GenerateSipBindings/cpplib.h')
-rw-r--r-- | tests/GenerateSipBindings/cpplib.h | 113 |
1 files changed, 113 insertions, 0 deletions
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 <QtCore/QObject> +#include <QtCore/QMap> + +#include <functional> + +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<int> addThree(QList<int> 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<Qt::MatchFlag> flags); + int localEnumTest(QFlags<MyObject::LocalEnum> flags); + + int functionParam(std::function<int()> fn); + int groups(unsigned int maxCount = std::numeric_limits<uint>::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; +}; + +} |