示例#1
0
 def _task_item_changed(self, item: QtGui.QStandardItem, task: Task,
                        column: Column) -> None:
     if column == Column.Name:
         new_name = item.data(QtCore.Qt.DisplayRole)
         self.rename_task_requested.emit(task, new_name)
     elif column == Column.Due:
         due = item.data(QtCore.Qt.DisplayRole)
         self.schedule_task_requested.emit(task, _qdate_to_date(due))
     elif column == Column.Snoozed:
         snoozed = item.data(QtCore.Qt.DisplayRole)
         self.snooze_task_requested.emit(task, _qdate_to_date(snoozed))
示例#2
0
 def item_changed(self, task_list: TasksView,
                  item: QtGui.QStandardItem) -> None:
     task = item.data(TASK_ROLE)
     column = task_list.columns()[item.column()]
     self._task_item_changed(item, task, column)