python - how to create a popup while loading data through method? -


i have method needs few second load data. these few second want display popup. problem python freezes starting load-method.

my first idea draw progressbar in qteditor , hide it. , then:

def load_data(self):   self.progressbar.sethidden(false)   [...load data...] 

the progressbar show, after load data.
thought if "outsource" "sethidden" work:

self.start.connect(self.load_data) def pre_load_data(self):   self.progressbar.sethidden(false)   self.start.emit()  #signal created myself def load_data(self):   [...load data...] 

but again progressbar created after process finished. tried make popup in other *.py file, , import it:
popup.py:

class popup(qtgui.qdialog):   def __init__(self):     qtgui.qwidget.__init__(self)     self.pp=ui_loading()      self.pp.setupui(self) 

and show popup before calling load_data-method:

def test(self):   self.bla = popup.popup()   self.bla.show()   self.load_data() 

the popup show inmediatly, empty. after load_data finished "interior" of popup show. have read little bit "subprocessing" thought there must easier way want. hope unterstand question , english, if have questions feel free ask :) thanks!


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

how to receive file in java(servlet/jsp) -