사용하는 모든 위젯를 들어 stylesheet
:
ui->setStyleSheet(
"QCheckBox:checked {
{color: black;}
}
QCheckBox:unchecked {
{color: grey;}
}"
)
편집 :
코멘트에서 언급 한 바와 같이
, 그것은 사용자 정의 테마와 함께 작동하게하려면, 당신은 스타일이 palette를 조회 할 수 있습니다 :
QPalette my_palette = ui->palette()
QColor my_active_color = my_palette.color(QPalette::Active, QPalette::Text);
QColor my_disabled_color = my_palette.color(QPalette::Disabled, QPalette::Text);
QString my_style =
QString("QCheckBox:checked { {color: rgb(%1, %2, %3);} } "
"QCheckBox:unchecked { {color: rgb(%4, %5, %6);}}")
.arg(my_active_color.red())
.arg(my_active_color.green())
.arg(my_active_color.blue())
.arg(my_disabled_color.red())
.arg(my_disabled_color.green())
.arg(my_disabled_color.blue());
ui->setStyleSheet(my_style);
id 그것을 시험해 본적이 없으며 오타가있을 수 있지만 아이디어를 얻을 수 있습니다.
"텍스트 비활성화"란 무엇을 의미합니까, '회색'텍스트입니까? –
@ YamHon.CHAN : 예 .... 기본적으로 텍스트 회색으로 표시됩니다. – Gojira