Hi friends,
i tried to change the text color of the QComboBox using QPalette ...
comboBox->setAutoFillBackground(true);
ComboBod::SelectedIndex(int index)
{
if(index == 1)
{
comboPalette.
setColor(QPalette::Text, Qt
::green);
comboPalette.
setColor(QPalette::WindowText, Qt
::green);
}else
{
comboPalette.setColor = parentWidget()->palette();
}
comboBox->setPalette(comboPalette);
}
comboBox->setAutoFillBackground(true);
ComboBod::SelectedIndex(int index)
{
QPalette comboPalette = palette();
if(index == 1)
{
comboPalette.setColor(QPalette::Text, Qt::green);
comboPalette.setColor(QPalette::WindowText, Qt::green);
}else
{
comboPalette.setColor = parentWidget()->palette();
}
comboBox->setPalette(comboPalette);
}
To copy to clipboard, switch view to plain text mode
but its not reflecting any change in the color ... i tried stylesheets also but not able to change the text of the comboBox .. only selection window text is changing ...
please hlp me ..
Thanks in advance
Bookmarks