user2234234
user2234234

Reputation: 349

how to wait to force subroutine to show widget before it continue to next line

I have this subroutine:

def checkout_button_handler(self):
   self.processing_label.show()
   self.qry_db()
   self.processing_label.hide() 
   return

when I call it, processing_label never shows, and it starts querying the db. How can I force showing this label before it moves to the next line ?

Upvotes: 1

Views: 57

Answers (1)

ekhumoro
ekhumoro

Reputation: 120778

Processing pending events before querying the db might help:

self.processing_label.show()
QtGui.qApp.processEvents() # or QtCore.QCoreApplication.processEvents()
self.qry_db()

Upvotes: 1

Related Questions