Worker = Worker (self. 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): Worker = Worker (self.StartMyApp) # Any other args, kwargs are passed to the run function "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 ") These royalty-free high-quality Loading Bar Lottie Animations are available in JSON, LOTTIE, GIF, AEP or MP4, and are available as individual or lottie animation packs. # = We need to block the Button Run and change its color Browse & download free and premium 14,811 Loading Bar Lottie Animations for web or mobile (iOS and Android) design, marketing, or developer projects. 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!!!! This tool is loading.ios animated image builder that helps you quickly make simple animations from your own image with custom design. 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. The loader I have been using in the screenshot above has been attached to this post.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. You can name the file whatever you like and then you will have to change the filename in the css-code also. Then change the css code in hooks/header-extras.php as you can see in the comments above. ![]() You can create your own custom animated loaders for example on this site:Īfter you have generated the loader, download it, copy it to the root directory of your application and name it "ajax-loader.gif". New AppGiniDetailView().ready(function() ) * hide detail view from the beginning on */
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |