Note that there are some explanatory texts on larger screens.

plurals
  1. POwhen and how to use PySide QEventLoop
    primarykey
    data
    text
    <p>I have an application in which I tried using a while loop but the application just hangs, and now I think I need to use QEventLoop to make the application work here is some of the relevant code</p> <pre><code>def ex_initialator(self): """ sets up things for the problem runner """ print "ayadara" print "self.start_button_status this is...::" ,self.start_button_status #:Pop up dialogs no_options_selected = QtGui.QMessageBox() select_range = QtGui.QMessageBox() select_op_type = QtGui.QMessageBox() #:Shows message if no options selected if len(self.op_types) &lt; 1 and len(self.num_range) &lt; 1 and self.start_button_status == 0: print "Please pick from the options provided" no_options_selected.exec_() #:Shows message if range is not selected if len(self.op_types) &gt;= 1 and len(self.num_range) &lt; 1 and self.start_button_status == 0 : print "Please pick at least one of the ranges" select_range.exec_() #:Shows message if op_type/s not selected if len(self.op_types) &lt; 1 and len(self.num_range) &gt;= 1 and self.start_button_status == 0: print "Please pick at least one of the operation types" select_op_type.exec_() #:Correct inputs initiates problem maker if len(self.op_types) &gt;= 1 and len(self.num_range) &gt;= 1 and (self.start_button_status == 0 or self.start_button_status == 1): self.start_button_status = 1 self.prob_signal.runner_sig.connect(self.problem_runner) self.prob_signal.runner_sig.emit() def problem_runner(self): """ Expression Makers """ while self.start_button_status == 1: #:picks range types range_type = random.choice(self.num_range) D = decimal.Decimal self.answer_lineEdit.returnPressed.connect(self.ex_evaluator) self.answer_lineEdit.clear() </code></pre> <p>what I want is to be able to start, pause, and stop buttons, I'm a beginner so I might have gone wrong in using QLineEdit in which case I would appreciate some suggestions as to a better implementation</p> <p><img src="https://i.stack.imgur.com/mAQrY.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload