That line you asked me is the way I found at the internet to get a 'handle' to an object created by Qt Designer, instead of manually creating it with commands. It works fine in program.cpp but not in window1.cpp.
Thanks.