I have a Qt Designer built GUI I am building with the PySide framework and the css file works fine in the designer tool but after I have used the pyside-uic
tool the css on the centralwidget object stops working.
I am using the pyside-uic tool as follows:
pyside-uic.exe FileIn.ui -o FileOut.py
In the generated code i have:
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
For the CSS i have:
MainWindow.setStyleSheet("QWidget#centralwidget{background-color:
qlineargradient(spread:pad, x1:0.683, y1:1, x2:1, y2:0, stop:0
rgba(103, 103, 103,255), stop:1 rgba(144, 144, 144, 255));
"}
The first line shows a warning in PyCharm stating:
"Instance attribute centralwidget defined outside __init__"
In the CSS if I target the QWidget i can get the style i want on the central widget but it then over rides the rest of my GUI.
Any suggestions?