0
經由
record = self.tablemodel.record()
record.setValue('originfile_path', filepath)
record.setValue('originfile_hash', filehash)
record.setValue('image', img_pkl)
record.setValue('area', area)
self.tablemodel.insertRecord(-1, record)
插入的記錄插入QSqlRecord成當QSqlTableModel的在QTableView中示出了帶有驚歎號作爲空白記錄發生問題
。它被插入數據庫關閉並重新打開應用程序導致記錄正常顯示。