QPalette palette; palette.setColor(QPalette::Background, Qt::blue); myQWidget->setPalette(palette);
QPalette palette = ui->myComboBox->palette(); palette.setColor(QPalette::Text, Qt::red); ui->myComboBox->setPalette(palette);This example gets the current palette of a QComboBox widget, sets the text color to red using the setColor function, and sets the updated palette back to the widget. Package/library: Qt