pyqt setStyleSheet用法

设置背景:

self.content_splitter.setStyleSheet("QSplitter.handle{background:lightgray}")

 

 设置padding

self.detailFrame.picLabel.setStyleSheet('''QLabel {padding: 10px;}''')

 

设置边框:

self.setStyleSheet(("border:1px solid red"))


MainWin::MainWin()

{

this->setStyleSheet("background-image:url(:/bmp/IMG_0345.JPG)");

iButton = new QPushButton(this);

iLabel = new QLabel(iButton);

QPalette palette; 

palette.setBrush(iLabel->backgroundRole(),QBrush(QImage(":/bmp/1257253475842.jpg")));

iLabel->setPalette(palette);

iLabel->setAutoFillBackground(true);

}


你可能感兴趣的:(pyqt)