Hi Guys!!
I have a weird problem with stylesheets in QSplashScreen.
When i explicit specify/set the stylesheet to the QSplashScreen widgets (indeed i am only styling an QProgressBar inside of it...) it works perfect.
But now, to simplify the implementation of the stylesheet and to not tell every single UI class which one to use, I am applying in the hole app using the qss file method , this is in __main__:
if __name__ == "__main__":
....
styleSheetFile = QFile ("images/OpenCoffee_style.qss") styleSheetFile.
open(QFile.
ReadOnly) app.setStyleSheet(defaultStylesheet)
if __name__ == "__main__":
app = QApplication(sys.argv)
....
styleSheetFile = QFile ("images/OpenCoffee_style.qss")
styleSheetFile.open(QFile.ReadOnly)
defaultStylesheet = QString(QLatin1String(styleSheetFile.readAll()))
app.setStyleSheet(defaultStylesheet)
To copy to clipboard, switch view to plain text mode
...
And with that the hole stylesheet is being applied to my app.
But no for the splashScreen... and that is weird... cause only there does not works.
I am attaching the splashScreen, if someone could help me here.
By the way, I call splash screen in my QMainWindow simply with:
self.splashScreen = splashScreen()
self.splashScreen = splashScreen()
To copy to clipboard, switch view to plain text mode
Just in case, the QProgressBar stylesheet (which WORKS by the way...):
color: #ffffff;
text-align: center;
font-weight: bold;
border-image: url(:/Styles/styles/progressBarBg.png) 1 4 1 4 stretch stretch;
border-width: 1px 4px 1px 4px;
padding-left:-3px;
padding-right: -3px;}
border-image: url(:/Styles/styles/progressBar.png) 0 10 0 10 stretch;
border-width: 0px 10px 0px 10px;}
QProgressBar:horizontal {
color: #ffffff;
text-align: center;
font-weight: bold;
border-image: url(:/Styles/styles/progressBarBg.png) 1 4 1 4 stretch stretch;
border-width: 1px 4px 1px 4px;
padding-left:-3px;
padding-right: -3px;}
QProgressBar::chunk:horizontal {
border-image: url(:/Styles/styles/progressBar.png) 0 10 0 10 stretch;
border-width: 0px 10px 0px 10px;}
To copy to clipboard, switch view to plain text mode
NOTE: as you mat notice, I code with PyQt...
Cheers and thanks in advance.
Bookmarks