I'm using Qt Creator, and I'm trying to figure out how to change the color of a LineEdit widget in a .cpp file based upon certain conditions.
The code below is what I have to try to change the color of the "thrull_01_le" LineEdit widget. "thrull_01_le" is the value set to 'objectName' of the LineEdit widget in Design mode. I confirmed that the the name "thrull_01_le" is defined as a LineEdit widget name in the .ui file.
However when I try to compile everything, I get the error "thrull_01_le' was not declared in this scope". Is there something I need to include, or is there a different way I should be referencing the widget? If you need more details on what I'm doing in the code, let me know, thanks!
Code:
QPalette p_thrull_01 (thrull_01_le->palette());
if (thrull_01_vitality == 100) {
p_thrull_01 (QPalette::Base,Qt::green);
thrull_01_le->setPalette(p_thrull_01);
}
--Shaun