How i populate QTableWidget from SQLite Query?
def proximo_alarm(self):
self.cur.execute('SELECT * FROM alunos')
a = 0
for row in self.cur:
b = 0
for item in self.cur[row]:
self.tMain.setItem(b, a, nw)
b += 1
a += 1
def proximo_alarm(self):
self.cur.execute('SELECT * FROM alunos')
a = 0
for row in self.cur:
b = 0
for item in self.cur[row]:
nw = QtGui.QWidgetItem(item)
self.tMain.setItem(b, a, nw)
b += 1
a += 1
To copy to clipboard, switch view to plain text mode
i get this error:
for item in self.cur[row]:
TypeError: 'sqlite3.Cursor' object is unsubscriptable
for item in self.cur[row]:
TypeError: 'sqlite3.Cursor' object is unsubscriptable
To copy to clipboard, switch view to plain text mode
Bookmarks