Implement setData for QSqltable to be editable
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#modifie the QSqlQueryModel to be editable and sets them to the database
|
||||
|
||||
from PySide6.QtSql import QSqlQueryModel, QSqlQuery
|
||||
from PySide6.QtCore import Qt
|
||||
#credits to :
|
||||
#https://stackoverflow.com/questions/49752388/editable-qtableview-of-complex-sql-query
|
||||
|
||||
@@ -32,6 +33,9 @@ class SqlQueryModel_editable(QSqlQueryModel):
|
||||
result = q.exec_()
|
||||
if result:
|
||||
self.query().exec_()
|
||||
# print("filter_value:",filter_value)
|
||||
print("setdata query: ",query.format(value, filter_value))
|
||||
print("index.row:",index.row(), "filter_col:",filter_col)
|
||||
else:
|
||||
print(self.query().lastError().text())
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user