Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
6.2.2
-
None
Description
i'll describe this problem with code:
cpp code:
class ISerializable { public: std::string addToState(std::string& _state, const ISerializable& _value, const std::string& _label = "") const { addToString(_state, &_value, _label); return _state; } }; class ExtBaseUiElement { }; template<class Tui, class Tval> class ExtUiElement : public ExtBaseUiElement, public ISerializable { }; class ExtCheckBox { }; class ExtCheckBoxBool : public ExtUiElement<ExtCheckBox, bool> { }; class GuiChart : public ISerializable { };
typesystem.xml:
<object-type name="ISerializable"/> <object-type name="GuiChart"/> <object-type name="ExtBaseUiElement"/> <object-type name="ExtUiElement" generate="no"/> <object-type name="ExtComboBox" generate="no"/> <object-type name="ExtUiElement<ExtCheckBox,bool>" generate="no"/> <object-type name="ExtCheckBoxBool"/>
python code:
import AppLib chart = AppLib.GuiChart() checkbox = AppLib.ExtCheckBoxBool() state = "" state = self.addToState(state, chart , "chart") # works state = self.addToState(state, checkbox , "checkbox") # not working
normally wrapped functions that expects base classes can take in types that derive from that base class (and it works nicely - as it should) - however the problem happens when we try to wrap type that inherits after template - which inherit after that base class.
shiboken complains (at the run time) - that it doesnt see function with needed type.
for now we work-around this by creating function overloads that expects exactly that type - and it works nicely however that doesnt look good in the code and in the documentation - alot of redundant functions in a few classes.
is it a bug or it is a limitation by design?