To describe the situation, I have numerous labels that follow a naming pattern of one11, one12 etc. The way I am attempting to access every label is by creating a QLabel pointer, which seems to be working okay. But then, when I attempt to access the background/button color of that label, my app crashes. Here is my code that I am attempting to use, and the app crashes on the last line in the first loop, am I using improper commands? Or possibly misunderstanding how to use the pointer?
Floor is a global string variable that keeps track of the users current tab in a stacked widget.(e.g. first panel = "one").
for(unsigned int i = 1; i <= 5; i ++){
for(unsigned int j = 1; j <= 5; j ++){
QString UI = (Floor + i + j);
QLabel * lbl = this->findChild<QLabel*>(UI);
QColor color = lbl->palette().button().color();