Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.11.1
-
None
Description
I would like to achieve the complete initialisation for specific objects by the usual constructor execution even if there are parameters involved which have not got a default value.
I tried to clarify the software situation by the discussion topic "Creating custom widgets based on constructors with parameters without default values" before to some degree.
An XML schema is published as a description for Qt Designer's UI file format. C++ source files are generated by the user interface compiler based on this data model. It seems that the model is designed in the way so far that objects are handled only when they are default-constructible. Now I am looking again for possibilities around corresponding extensions.
Some Qt classes accept null pointers as a default construction parameter like "parent". If additional parameters are needed there because special settings can be performed only in the implementation of a constructor for a derived class, they should be passed somehow. I see software design options like the following then.
The passing method for extra data can become configurable. (It depends on the amount of C++ source code which can be handled there.)
- The existing parameter can be replaced by an other class which provides the desired information. The previous argument value can be configured and queried by this adjustment.
- Parameter lists (including non-default values) would become supported.