I’ve designed a mainwindow.ui in Qt Designer(4.8.2) in Microsoft Windows Vista, after previewing and being satisfied by the result then I used pyside-uic and got the generated mainwindow.py.
But when I run my app, the display is different from what I saw in the Qt Designer preview and is different from preview from the pyside-uic –preview:
What I used to get the preview:
pyside-uic mainwindow.py -p
The init of my app:
from PySide.QtGui import QApplication, QMainWindow
from mainwindow import Ui_MainWindow
import sys
class bookcalendar(Ui_MainWindow, QMainWindow):
def __init__(self):
super(bookcalendar, self).__init__()
self.setupUi(self)
app = QApplication(sys.argv)
form = bookcalendar()
form.show()
app.exec_()
what I saw running pyside-uic -p script,

what I saw running .py file,

stackedWidget(parent)
--bookStack <- my style sheet css
--calendarStack <- my style sheet css
css of the missing gray border:
#bookStack{
"border: 3px solid gray;
"background-color: white;}
Well, any suggestions?
I found the answer, the workaround is to add the style sheet css in the parent, like:
the right way to do css stylesheet: