您的位置:首页 > Web前端 > CSS

Qt设置圆角按钮样式

2012-08-19 09:45 549 查看
Qt中使用stylesheet方式将按钮设置成圆角按钮,代码如下:

setStyleSheet("border:2px groove gray;border-radius:10px;padding:2px 4px;");

如pushButton如下用法:

pushButton->setStyleSheet("border:2px groove gray;border-radius:10px;padding:2px 4px;");

更多>setStyleSheet用法如下:

qApp->setStyleSheet("QLineEdit { background-color: yellow }");

myDialog->setStyleSheet("QLineEdit { background-color: yellow }");

myDialog->setStyleSheet("QLineEdit#nameEdit { background-color: yellow }");

nameEdit->setStyleSheet("background-color: yellow");

nameEdit->setStyleSheet("color: blue; background-color: yellow");

nameEdit->setStyleSheet("color: blue;"
"background-color: yellow;"
"selection-color: yellow;"
"selection-background-color: blue;");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: