olzmuslim.blogg.se

Windows 10 loading loop gif
Windows 10 loading loop gif












windows 10 loading loop gif

Worker = Worker (self.PreparingMyApp) # Any other args, kwargs are passed to the run function Self.gif_loading = QMovie ('ui/loading.gif') Worker = Worker (self.StartMyAppReport) # Any other args, kwargs are passed to the run functionĭef StartPreparingMyApp(self): #<= This method doesn't work !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (self.progress_fn)ĭef PreparingMyApp(self, progress_callback):

windows 10 loading loop gif windows 10 loading loop gif

Worker = Worker (self.StartMyApp) # Any other args, kwargs are passed to the run function

windows 10 loading loop gif

"Press 'button 'Quit' to stop and turn off MyApp.") Self.EditTextFieldUi (self.label_HeaderMsg2, '#ff8a00', You can press the button 'Report' to see what MyApp has done.") Self.EditTextFieldUi (self.label_HeaderMsg1, '#ff8a00', Self.gif = QMovie ('ui/animated_gif_logo_UI_.gif') Self.button_Run.setStyleSheet ("background-color: #ffcc00 ") # = We need to block the Button Run and change its color Self.button_ (self.ButtonStartMyApp)ĭef StartMyAppReport(self, progress_callback):ĭef ButtonStartMyApp(self): #<= This method works perfectly by showing the loading gif. Self.button_ (self.ButtonStartMyAppReport) # = Associate methods to the buttons of the UI = Self.StartPreparingMyApp() #<= This method doesn't work!!!! Print("Multithreading with maximum %d threads" % ()) # = THis will handle the MULTITHREAD PART = (result) # Return the result of the processing ((exctype, value, traceback.format_exc ())) Result = self.fn (*self.args, **self.kwargs) # Retrieve args/kwargs here and fire processing using them Initialise the runner function with passed args, kwargs. # Store constructor arguments (re-used for processing) :param kwargs: Keywords to pass to the callback function :param args: Arguments to pass to the callback function Kwargs will be passed through to the runner. :param callback: The function callback to run on this worker thread. Inherits from QRunnable to handler worker thread setup, signals and wrap-up. `object` data returned from processing, anything `tuple` (exctype, value, traceback.format_exc() ) I don't understand because the "Run" button works perfectly by showing the gif and running the main code without freezing the UI whereas my "preparing" code is not showing the gif and freezing my UI until it finishes.ĭoes anyone understand the source of this issue? from PyQt5 import QtWidgets, uic, QtGuiĭefines the signals available from a running worker thread. So I thought by cloning the same logic, I could display another loading gif at the init of my UI but it didn't work. My script has a button to Run my main script "StartMyApp" and show an animated gif while MyApp is running without freezing my UI. Instead of showing the gif, the UI is blocked(froze) waiting for my preparing script to finish its job. When I execute my code, it shows immediately the UI, then it supposes to make some other preparing stuff and display a loading gif while these initialization tasks are running.














Windows 10 loading loop gif