Hi aomegax, I think all depends of what you wish to do with the returned type. If you are going to used as a regular QWidget and add it to another Layout (for example, QHBoxLayout or QVBoxLayout, etc), then of course you should return a QWidget. But, if you wish to use the returned type as a container of QWidgets, or you are going to add more elements after call creaItemCliente; would be better to use a Layout as the returned type.
It's also important to note, the Parent-Child relationship between the components. Remember that if you call setLayout on a QWidget, all the components that you added to the QWidget via the QLayout, will be childs of the QWidget, not the QLayout.
So, it would be thoughtful if you have into account both of the recommendation I gave you.
I Hope this answers your question.




Reply With Quote

Bookmarks