当我使用showFullScreen()函数之后没有显示新添加的元素但我可以删除元素。
此外,如果我在元素添加代码后编写showFullScreen(),则会显示元素。
class MyApp(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setGeometry(300, 300, 600, 600)
resolution = QtGui.QDesktopWidget().screenGeometry()
self.wheight = resolution.height()
self.wwidht = resolution.width()
self.centralwidget = QtGui.QWidget(self)
self.centralwidget.setObjectName("first")
self.splash_from = QtGui.QWidget(self.centralwidget)
self.splash_from.setGeometry(QtCore.QRect((self.wwidht - 1000) / 2, (self.wheight - 761) / 2, 1000, 761))
self.splash_from.setObjectName(("Splash"))
self.logo_img = QtGui.QLabel(self.splash_from)
self.logo_img.setPixmap(QtGui.QPixmap(os.getcwd() + "/logo.png"))
self.splash_from2 = QtGui.QWidget(self.centralwidget)
self.splash_from2.setGeometry(QtCore.QRect(50, ((self.wheight - 761) / 2) + 761, 700, 100))
self.splash_from2.setObjectName(("Splash"))
self.logo_text = QtGui.QLabel(self.splash_from2)
self.logo_text.setGeometry(QtCore.QRect(0, 0, 15000, 100))
self.logo_text.setStyleSheet('font-size: 18pt; color:red')
self.logo_text.setText(u"Loading...")
self.threadPool = []
self.showFullScreen();
self.splash_from2 = QtGui.QWidget(self.centralwidget)
self.splash_from2.setGeometry(QtCore.QRect(50,50,500,500))
self.splash_from2.setObjectName(("Splash"))
self.logo_text = QtGui.QLabel(self.splash_from2)
self.logo_text.setGeometry(QtCore.QRect(0, 0, 15000, 100))
self.logo_text.setStyleSheet('font-size: 18pt; color:red')
self.logo_text.setText(u"test...")
# self.showFullScreen();
感谢您的帮助,并为不良的英语抱歉:)