以QLabel为列:
设置Qss如下
QLabel{
border-top: 5px solid qlineargradient(y0:0, y1:1,stop: 0 #ececef, stop: 1 white);
border-left: 5px solid qlineargradient(x0:0, x1:1,stop: 0 #ececef, stop: 1 white);
border-bottom: 5px solid qlineargradient(y0:0, y1:1,stop: 0 white, stop: 1 #ececef);
border-right: 5px solid qlineargradient(x0:0, x1:1,stop: 0 white, stop: 1 #ececef);
background-color: rgb(255,255,255);
}
效果: