diff options
-rw-r--r-- | find-modules/sip_generator.py | 9 | ||||
-rw-r--r-- | tests/GenerateSipBindings/cpplib.cpp | 20 | ||||
-rw-r--r-- | tests/GenerateSipBindings/cpplib.h | 5 |
3 files changed, 34 insertions, 0 deletions
diff --git a/find-modules/sip_generator.py b/find-modules/sip_generator.py index 621fe711..4b81ca33 100644 --- a/find-modules/sip_generator.py +++ b/find-modules/sip_generator.py @@ -578,6 +578,9 @@ class SipGenerator(object): def _get_param_type(parameter): result = parameter.type.get_declaration().type + if parameter.type.get_declaration().type.kind == TypeKind.INVALID: + return parameter.type + if (parameter.type.get_declaration().type.kind == TypeKind.TYPEDEF): isQFlags = False for member in parameter.type.get_declaration().get_children(): @@ -592,6 +595,12 @@ class SipGenerator(object): def _get_param_value(text, parameterType): if text == "0" or text == "nullptr": return text + if text == "{}": + if parameterType.kind == TypeKind.ENUM: + return "0" + if parameterType.kind == TypeKind.POINTER: + return "nullptr" + return parameterType.spelling + "()" if not "::" in parameterType.spelling: return text try: diff --git a/tests/GenerateSipBindings/cpplib.cpp b/tests/GenerateSipBindings/cpplib.cpp index e7cb1d17..af689966 100644 --- a/tests/GenerateSipBindings/cpplib.cpp +++ b/tests/GenerateSipBindings/cpplib.cpp @@ -105,6 +105,26 @@ void MyObject::enumNullptr(Qt::WindowFlags f) } +void MyObject::enumBraces(Qt::WindowFlags f) +{ + +} + +void MyObject::stringBraces(QString s) +{ + +} + +void MyObject::intBraces(int i) +{ + +} + +void MyObject::pointerBraces(int* p) +{ + +} + LocalFwdDecl::LocalFwdDecl(int value) : m_value(value) { diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h index c54b6b7a..60c5c66a 100644 --- a/tests/GenerateSipBindings/cpplib.h +++ b/tests/GenerateSipBindings/cpplib.h @@ -53,6 +53,11 @@ public: void enumNullptr(Qt::WindowFlags f = nullptr); + void enumBraces(Qt::WindowFlags f = {}); + void stringBraces(QString s = {}); + void intBraces(int i = {}); + void pointerBraces(int* p = {}); + int const_parameters(const int input, QObject* const obj = 0) const; int externalFwdDecl(const ExternalFwdDecl& f); |