CodePudding user response:
LZ you this writing is not an error? Right should write QWidget so * taishiback=new QWidget (this);CodePudding user response:
QMainWindow setCentralWidget (), please set control centerCodePudding user response:
//taishiback - & gt; Show (); Why do you want to comment out? Encountered this problem before, and the show will be displayed, commented how display have a look at the UI files are generated that ui_XXXXX. H file, where the function is called the showCodePudding user response:
Don't come out, and finally in the interface directly pulled a, but this method sets the background color, and still on the road is not easyCodePudding user response:
Add the following code QWidget * taishiback=new QWidget; Taishiback - & gt; SetGeometry (420370320-30); QPalette the palette. The palette. SetBrush (QPalette: : Background, QBrush (Qt: : red)); Taishiback - & gt; SetPalette (palette); Taishiback - & gt; SetEnabled (true); Taishiback - & gt; SetAutoFillBackground (true); Taishiback - & gt; SetParent (this); Display a red rectangular patten form the lower right cornerCodePudding user response:
Don't add the layout editor are easy to be blocked by other controls, naturally can not seeCodePudding user response:
SetParent (centerWidget ());