Answer the question
In order to leave comments, you need to log in
How to search for entered value in QTableWidget?
I enter the value that I want to find, and it seems to be added again.
Before
After:
Code:
def Search(self):
db = sqlite3.connect('tableDB.db')
cursor = db.cursor()
nbr = self.lineEdit.text()
content = 'SELECT * FROM information WHERE Password = ?'
res = cursor.execute(content, [nbr])
for row_index, row_data in enumerate(res):
self.tableWidget.insertRow(row_index)
for colm_index, colm_data in enumerate(row_data):
self.tableWidget.setItem(row_index, colm_index,QTableWidgetItem(str(colm_data)))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question