分享

Qt设置圆角按钮样式

 风之library 2014-12-25
                        Qt中使用stylesheet方式将按钮设置成圆角按钮,代码如下:[喝小酒的网摘]http://blog./a/8332.htm

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;");[喝小酒的网摘]http://blog./a/8332.htm

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多