Hello!
I apologize to disturb you. I am facing a problem of setting a background image to my widget.
I have applied the following function, but the widgest has turned to black completely:
QPalette palette;
QString appDir = QApplication::applicationDirPath();
palette.setBrush(this->backgroundRole(),QBrush(QImage(appDir +"/Background.png")));
this->setPalette(palette);
Does anyone has a idea how to solve the problem?
I will be greatfull to everyone who would help me solving this problem:
-either by telling me why the widget has turned to black
-or by recommending me aonther function.
Many thanks in advance.