def setEditorData(self, editor: QWidget, index: PySide2.QtCore.QModelIndex): editor: PathBrowseWidget path = index.data(Qt.EditRole) editor.set_path(path) if not self._path_been_set: self._path_been_set = True if not path: editor.browse()
def table_row_double_clicked(self, index: PySide2.QtCore.QModelIndex): ts_code = index.data(MainTableModel.PRIMARY_KEY_ROLE) print(ts_code) self.view_model.set_curr_selected_stock(ts_code)
def setEditorData(self, editor: QWidget, index: PySide2.QtCore.QModelIndex): editor: ColorEditWidget color = index.data(Qt.DecorationRole) editor.set_color(color)