wagmare
29th November 2011, 06:58
Hi friends,
i tried to change the text color of the QComboBox using QPalette ...
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);
}
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
i tried to change the text color of the QComboBox using QPalette ...
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);
}
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