aboutsummaryrefslogtreecommitdiffstats
path: root/qface/helper
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com>2018-01-25 14:26:07 +0100
committerJuergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com>2018-01-25 14:26:07 +0100
commitaef0548e6963b163e7e0e2a35db8efa87f13ee14 (patch)
tree1fae1838a95816515e47e4e8855bac2697e577fd /qface/helper
parentcf676a4340f64f6a5b9f38b4e2bd3401c6d57d47 (diff)
- Updated enum test. No test will pass again.
- also switched to yaml safe loader
Diffstat (limited to 'qface/helper')
-rw-r--r--qface/helper/qtcpp.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py
index 015bfdb..5ae13b5 100644
--- a/qface/helper/qtcpp.py
+++ b/qface/helper/qtcpp.py
@@ -33,9 +33,8 @@ class Filters(object):
elif t.is_void:
return ''
elif t.is_enum:
- module_name = upper_first(t.reference.module.module_name)
value = next(iter(t.reference.members))
- return '{0}{1}Module::{2}'.format(prefix, module_name, value)
+ return '{0}::{0}Enum::{1}'.format(symbol.type, value)
elif t.is_flag:
return '0'
elif t.is_list:
@@ -56,9 +55,8 @@ class Filters(object):
@staticmethod
def parameterType(symbol):
prefix = Filters.classPrefix
- module_name = upper_first(symbol.module.module_name)
if symbol.type.is_enum:
- return '{0}{1}Module::{2} {3}'.format(prefix, module_name, symbol.type, symbol)
+ return '{0}::{0}Enum {1}'.format(symbol.type, symbol)
if symbol.type.is_void or symbol.type.is_primitive:
if symbol.type.is_string:
return 'const QString &{0}'.format(symbol)
@@ -82,7 +80,7 @@ class Filters(object):
return '{0}{1}Model *{2}'.format(prefix, nested, symbol)
elif symbol.type.is_complex:
if symbol.type.is_interface:
- return '{0} *{1}'.format(symbol.type, symbol)
+ return '{0}Base *{1}'.format(symbol.type, symbol)
else:
return 'const {0}{1} &{2}'.format(prefix, symbol.type, symbol)
raise Exception("Unknown symbol type")
@@ -90,10 +88,9 @@ class Filters(object):
@staticmethod
def returnType(symbol):
prefix = Filters.classPrefix
- module_name = upper_first(symbol.module.module_name)
t = symbol.type
if t.is_enum:
- return '{0}{1}Module::{2}'.format(prefix, module_name, symbol.type)
+ return '{0}::{0}Enum'.format(symbol.type)
if symbol.type.is_void or symbol.type.is_primitive:
if t.is_string:
return 'QString'
@@ -120,7 +117,7 @@ class Filters(object):
return '{0}{1}Model *'.format(prefix, nested)
elif symbol.type.is_complex:
if symbol.type.is_interface:
- return '{0}*'.format(symbol.type)
+ return '{0}Base *'.format(symbol.type)
else:
return '{0}{1}'.format(prefix, symbol.type)
raise Exception("Unknown symbol type")