Setminimumsize (qsize (1, 800,800 ));
Setattribute (QT: wa_translucentbackground, true); // [1]
Setstylesheet ("background-color: Transparent"); // [2]
Setwindowflags (QT: framelesswindowhint );
Qpushbutton * pbutton = new qpushbutton;
Pbutton-> setparent (this );
Pbutton-> setgeometry (100,100,200,100 );
Pbutton-> settext ("button ");
Pbutton-> setstylesheet ("background-color: RGB (255,100, 255,255,255); color: RGB );");
You can use the above settings to obtain a fully transparent background window. The experiment found that [1] and [2] are indispensable. From the function literal perspective, you should call one of the functions to achieve full transparency. Later, I wanted to use setstylesheet ("background-color: RGB (100,100, 0,100)"); To set translucent, and found no effect. I don't know how to set the translucent background window separately. If you callSetwindowopacity () makes the background window and controls transparent.