我使用Qt4.8创建一个按钮,然后使用setStyleSheet函数为该按钮和工具提示设置样式。但是这段代码只适用于按钮和工具提示不起作用。这是我的密码
QPushButton *status_label;这->
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}"));
请帮帮我。
发布于 2015-08-13 12:43:47
您需要为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);https://stackoverflow.com/questions/31979224
复制相似问题