解决的办法是: Open the .ui file using a text editor (not Qt Designer) and do a search for "layoutWidget". You should find it twice. Change the name of one to something unique, and the warning will go away. 需要修改为不同的值。如layoutWidget1 layoutWidget2……