我使用Qt4.8创建一个按钮,然后我使用setStyleSheet函数为这个按钮和工具提示设置样式.但是这个代码只适用于按钮和工具提示是行不通的.这是我的代码
QPushButton *status_label;
Run Code Online (Sandbox Code Playgroud)
这 - >
cellGUI.status_label-> setStyleSheet(QString :: fromUtf8("QPushButton {color:#E6E6E6; font-weight:bolder; font-family:tahoma; font-size:6px; background-color:rgb(255,153,0)) } QPushButton :: QToolTip {color:#2E2E2E; background-color:#CCCCCC; border:none}"));
请帮我.
小智 5
您需要为QToolTip添加样式表.例:
QString style = QString(
"QPushButton {"
// StyleSheet for your push button
" background: blue;"
"}"
"QToolTip {"
// StyleSheet for tool tip
" background: red;"
"}"
);
this->cellGUI.status_label->setStyleSheet(style);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4362 次 |
| 最近记录: |