ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

qt setStyleSheet 设置多个属性{}之间用空格间隔

qt setStyleSheet 设置多个属性{}之间用空格间隔

setStyleSheet 设置多个属性时,大属性之间不能用分号,用 空格进行间隔

pbtn1->setStyleSheet("QPushButton {background-color: rgb(4,138,224);font: bold 12pt;color: rgb(255,255,255);} QPushButton:hover,QPushButton:pushed {background-color: rgb(55,121,195);font: bold 12pt;color: rgb(255,255,255);}");

注意:
QPushButton {} 与 QPushButton:hover,QPushButton:pushed {}
之间 空格 间隔,不要用分号。

{}与{}之间用空格
{}内,小属性之间用分号

返回列表