Changed code according to your comments on https://phabricator.kde.org/differential/revision/inlines/21977/
(for done status)
I have tried using enum Type and Subtype in Struct Test, and set the visible property of various widgets based on values of the struct.
so, it is a solution to these problems