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;");
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;");
相关文章推荐
- QT设置ToolButton按钮的样式
- Qt按钮为什么设置了三态点击样式效果,无法得到预期,enabled属性为何无法选中 - C/C++解惑之Qt
- Qt中使用stylesheet方式将按钮设置成圆角按钮,
- QT设置ToolButton按钮的样式
- 设置UISearchBar的按钮字体样式
- css3圆角样式分享自定义按钮样式
- QT 按键样式设置
- QT中设置按钮背景颜色
- Flex中通过textAlign样式在一个按钮(Button)控件中设置标签(label)对齐方式的例子
- IDE的按钮样式设置(蓝色、灰白色)
- 设置圆角虚线样式
- Qt中使用setStyleSheet对按钮进行外观设置
- QT界面,按钮,Label背景图片设置方法
- Qt设置窗口、按钮背景色
- Qt 之 设置窗口边框的圆角(使用QSS和PaintEvent两种方法)
- Qt中使用setStyleSheet对按钮进行外观设置
- Qt自定义图片按钮并设置方向
- 由如何设置圆角按钮引发的思考
- Qt 的一些心得(背景设置,圆角,半透明)
- 设置按钮(UIButton)为圆角矩形