2
我試圖在MessageBox內容中將所有字體顏色更改爲白色,但它不會將href字體顏色也更改爲白色。 下面的代碼:更改QMessageBox中的字體顏色PyQt5
def MsgBox(self):
qmsgBox = QMessageBox()
qmsgBox.setStyleSheet('QMessageBox {background-color: #2b5b84; color: white;}\n QMessageBox {color: white;}\n QPushButton{color: white; font-size: 16px; background-color: #1d1d1d; border-radius: 10px; padding: 10px; text-align: center;}\n QPushButton:hover{color: #2b5b84;}')
QMessageBox.about(qmsgBox, 'SuperPyQtCalculator',
"""<font color='white'><p><b>SuperPyQtCalculator</b></p>
<p><b>Version:</b> {0}</p>
<p><b>Author: </b> {1}</p>
<p><b>Web:</b> <a href='www.linuxmusica.com'>Linux Music 3.0</a></p>
<p><b>Copyright:</b> © 2014 Qtrac Ltd.
All rights reserved.
<p>This application can be used to calculate
simple math science operations.</p>
<p><b>You are using:</b></p>
<p>Python {2} - Qt {3} - PyQt {4} on {5}</p></font>""".format(
__version__, __author__, platform.python_version(),
QT_VERSION_STR, PYQT_VERSION_STR, platform.system()))
我不能與A HREF顏色樣式並與HTML屬性附加傷害發生變化。 謝謝