QPalette* palette = new QPalette();
To copy to clipboard, switch view to plain text mode
In the first case, this is a memory leak. You should simply retrieve the existing palette from the widget:
QPalette palette
= final_angle
->palette
();
palette.setColor( /* whatever */ );
final_angle->setPalette( palette );
QPalette palette = final_angle->palette();
palette.setColor( /* whatever */ );
final_angle->setPalette( palette );
To copy to clipboard, switch view to plain text mode
And if you read the QPalette documentation, you will see that QPalette::Background is an obsolete ColorRole. You should probably be using QPalette::Window or QPalette::Button; I don't know how painting in QLCDNumber is implemented, so I don't know which role it uses to paint its background.
You do read the documentation sometimes, don't you? Or do you just simply post a question for every problem you run into?
Bookmarks