JimKarvo
7th November 2019, 11:26
Hello,
I know this is a QT Forum and no specified PyQT / Python forum
But The problem I face maybe is "so easy" but I can't see the solution
I have this Python Code.
First I open an QMainWindow as Splash Screen, while I load the settings, customers, sales etc..
But When I close the Splash Screen, and open the Main Screen, the taskbar details disappeared!
This is the code:
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
import os
import sys
import time
class ThreadProgress(QThread):
mysignal = pyqtSignal(int, str)
def __init__(self, parent=None):
QThread.__init__(self, parent)
def run(self):
i = 0
while i < 102:
time.sleep(0.02)
self.mysignal.emit(i, "txt")
i += 1
FROM_SPLASH, _ = loadUiType(os.path.join(os.path.dirname(__file__), "splash.ui"))
FROM_MAIN, _ = loadUiType(os.path.join(os.path.dirname(__file__), "mainwindow FRAME.ui"))
class Main(QMainWindow, FROM_MAIN):
def __init__(self, parent=None):
super(Main, self).__init__(parent)
self.setupUi(self)
class Splash(QMainWindow, FROM_SPLASH):
def __init__(self, parent=None):
super(Splash, self).__init__(parent)
QMainWindow.__init__(self)
self.setupUi(self)
pixmap = QPixmap("splash_logo.png")
self.splah_image.setPixmap(pixmap.scaled(350, 152))
progress = ThreadProgress(self)
progress.mysignal.connect(self.progress)
progress.start()
@pyqtSlot(int, str)
def progress(self, i, txt):
if i == 101:
self.close()
self.setStyleSheet("")
main = Main(self)
main.show()
self.progressBar.setValue(i)
self.SubText.setText(txt)
def main():
app = QApplication(sys.argv)
splash = Splash()
splash.show()
app.exec_()
if __name__ == '__main__':
try:
main()
except Exception as why:
print(why)
Can you suggest me a solution?
Thank you very much
I know this is a QT Forum and no specified PyQT / Python forum
But The problem I face maybe is "so easy" but I can't see the solution
I have this Python Code.
First I open an QMainWindow as Splash Screen, while I load the settings, customers, sales etc..
But When I close the Splash Screen, and open the Main Screen, the taskbar details disappeared!
This is the code:
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
import os
import sys
import time
class ThreadProgress(QThread):
mysignal = pyqtSignal(int, str)
def __init__(self, parent=None):
QThread.__init__(self, parent)
def run(self):
i = 0
while i < 102:
time.sleep(0.02)
self.mysignal.emit(i, "txt")
i += 1
FROM_SPLASH, _ = loadUiType(os.path.join(os.path.dirname(__file__), "splash.ui"))
FROM_MAIN, _ = loadUiType(os.path.join(os.path.dirname(__file__), "mainwindow FRAME.ui"))
class Main(QMainWindow, FROM_MAIN):
def __init__(self, parent=None):
super(Main, self).__init__(parent)
self.setupUi(self)
class Splash(QMainWindow, FROM_SPLASH):
def __init__(self, parent=None):
super(Splash, self).__init__(parent)
QMainWindow.__init__(self)
self.setupUi(self)
pixmap = QPixmap("splash_logo.png")
self.splah_image.setPixmap(pixmap.scaled(350, 152))
progress = ThreadProgress(self)
progress.mysignal.connect(self.progress)
progress.start()
@pyqtSlot(int, str)
def progress(self, i, txt):
if i == 101:
self.close()
self.setStyleSheet("")
main = Main(self)
main.show()
self.progressBar.setValue(i)
self.SubText.setText(txt)
def main():
app = QApplication(sys.argv)
splash = Splash()
splash.show()
app.exec_()
if __name__ == '__main__':
try:
main()
except Exception as why:
print(why)
Can you suggest me a solution?
Thank you very much