pyQt click event and data transmission

First PushButton click event, then click the button to send the text input box textEdit to the background.

. 1   DEF retranslateUi (Self, the MainWindow):
 2          _translate = QtCore.QCoreApplication.translate
 . 3          MainWindow.setWindowTitle (_translate ( " the MainWindow " , " the MainWindow " ))
 . 4          self.B_yuyin.setText (_translate ( " the MainWindow " , " long press Voice input " ))
 . 5          self.B_wenjian.setText (_translate ( " the MainWindow " , " select file input " ))
 . 6          self.predect.setText(_translate("MainWindow", "进行预测"))
 7         self.predect.clicked.connect(self.Start)
 8 
 9     def Start(self):
10         print(self.textEdit.toPlainText())
self.predect.clicked.connect (self.Start) is a button click event, click on the Start event and connect (connect) 
in which Star can write a lot, such as printing textEdit inside the text, such as opening a new interface, such as running another bag program.

Guess you like

Origin www.cnblogs.com/riddle/p/11583656.html