


Self.add_(self.addRow)įor column in range(()): Self.add_row = QPushButton("Add Row", localWidget) (self.proxy) # Revised code, for View/Proxy/Model #(self.model) # Original code, for View/Model Self.proxy = CustomProxyModel() # Customized Filter Text = self.sourceModel().index(source_row, column, source_parent).data()Įxpresion, Qt.CaseInsensitive, QRegExp.RegExpĭata =, ] Return super().flags(index) | Qt.ItemIsEditableĬlass CustomProxyModel(QSortFilterProxyModel):ĭef filterAcceptsRow(self, source_row, source_parent):įor column, expresion in (): Return self._dataĭef setData(self, index, value, role=Qt.EditRole): If role in (Qt.DisplayRole, Qt.EditRole): Self.beginInsertRows(QModelIndex(), self.rowCount(), self.rowCount())ĭef data(self, index, role=Qt.DisplayRole): Return super().createEditor(parent, option, index) # QLineEdit for string values and QTimeEdit for QTime values # no need to check for the other columns, as Qt automatically creates a Def createEditor(self, parent, option, index):
