So, I'm not sure if the title is the best description, but it's what I came up with. Here's the deal. I'm working on a PyQt app that has a sort of plugin system where you can just add some sub classes to a folder and the app finds them. These commands have the option of being able to create little uis for themselves. Basically, they look like this:
class Command(object):
def do(self):
self.setupUi()
self.pre()
self.run()
self.post()
def pre(self):
# do setup stuff for run method
def run(self):
# do actual work
def post(self):
# clean up after run
def setupUi(self):
# create a ui for this command
diag = QDialog()
diag.exec_()
Now, the issue I'm running into is, I have one Command that creates a dialog, and waits for the user to accept it. Then, I need to switch the dialog to non-modal while the command is running, and up date the dialog. This all seems to work fine. But, the problem is I can't get the dialog to redraw until after the pre, run, and post methods have finished. So, if I have the setupUi like this:
def setupUi(self):
# create a ui for this command
diag = QDialog()
if diag.exec_():
diag.setModal(False)
diag.show()
I tried processEvents but that didn't seem to do it. Has anyone else run into this issue, or know of any work arounds?
Thanks