QLabel が 1 つ、QLineEdit が 1 つ、QPushButton が 1 つの「検索」を含む QDialog があります。ボタンを押した後、QLineEdit に入力されたテキストを、検索ボタンのアクションを処理する別の関数に送信したいと思います。
# shows and handles the find dialog
def handleFind(self):
findDialog = QDialog()
findDialog.setWindowTitle("Find")
grid = QGridLayout()
findDialog.setLayout(grid)
findLabel = QLabel("Find what", findDialog)
grid.addWidget(findLabel,1,0)
findField = QLineEdit(findDialog)
grid.addWidget(findField,1,1)
enteredText = findLabel.text()
findButton = QPushButton("Find", findDialog)
# how to send enteredText as parameter to the find function
findButton.clicked.connect(self.find)
grid.addWidget(findButton,2,1)
findDialog.exec_()
# find function: search in the first column of the table
def find(self):
#to do
names = NvmQtModel.__imp.parameterNames()
QLineEdit に入力されたテキストをパラメーターとして関数に送信するにはどうすればよいfind
ですか?