QPalette pal = widget->palette(); pal.setBrush(QPalette::Background, Qt::yellow); widget->setPalette(pal);
QPalette pal = comboBox->palette(); pal.setBrush(QPalette::Text, Qt::blue); comboBox->setPalette(pal);This code snippet sets the text color of the given QComboBox object to blue using setBrush and the QPalette::Text role. Package Library: Qt