qt4 StyleSheet的总结

来源:互联网 发布:#NAME? 编辑:程序博客网 时间:2024/05/18 03:47
QApplication::setStyleSheet(QString);
QWidget::setStyleSheet(QString);

1. 程序级的外观:(作用于整个程序的器件)
如:

QLineEdit { background: yellow }
QCheckBox { color: red }

2. 器件级的外观:(作用于本器件及其子器件)
如:

textViewer->
setStyleSheet("background-color: #FFFFBB;"
                "color: #000099;"
                "margin: 10px;"
                "padding: 5px;"
                "padding-left: 15px;"
                "padding-right: 15px;"
                "border-radius: 5px;" // 圆角边框(只用IE的人就不知道了吧:D)
                "border: 3px solid #abc;");
 
 

"background-color: #FFFFBB;"
                "color: #000099;"
                "margin: 10px;"
                "padding: 5px;"
                "padding-left: 15px;"
                "padding-right: 15px;"
                "border-radius: 5px;" // 圆角边框(只用IE的人就不知道了吧:D)
                "border: 3px solid #abc;"
 
 
这只是基础,其他的可根据实际情况,按帮助asstiant上的说明写
原创粉丝点击