Infact tree widget need a infotable result as it's imput data, which means that you can use a database data to be bounded with a tree widget. But the table type is strict.
Below screenshot is a table that can be bounded to a tree widget.
Tree attributes settings:
Should you have any furhter concern, please feel free to let me know.