前提
Weather::Weather(QWidget *parent) : QWidget(parent)
解决方案
在Weather构造函数中使用此方法即可非常好用!
this->setObjectName("weatherWindow");
this->setStyleSheet(R"(
#weatherWindow {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #537895, stop:1 #336699);
border-radius:10px;
}
)");
this->setAttribute(Qt::WA_StyledBackground);

被折叠的 条评论
为什么被折叠?



