Have you tried it?
Since one of the tree widgets is hidden the sizeHint of the dialog will be exactly the width of the visible tree widget.

Marcel