Added API to create a tree of QObjects