コード例 #1
0
    def editNewTodo(self):
        """Sets the current todo to a newly created todo"""
        newTodo = QOrganizerTodo()
        newTodo.setPriority(QOrganizerItemPriority.HighPriority)
        newTodo.setStatus(QOrganizerTodoProgress.StatusNotStarted)
        currentDateTime = QDateTime(QDate.currentDate(), QTime.currentTime())
        newTodo.setStartDateTime(currentDateTime)
        newTodo.setDueDateTime(currentDateTime.addSecs(60 * 60))

        self._todo = newTodo
        self._todo.isNewTodo = True
        self.currentTodoChanged.emit()
コード例 #2
0
ファイル: qmltodo.py プロジェクト: AmerGit/Examples
    def editNewTodo(self):
        """Sets the current todo to a newly created todo"""
        newTodo = QOrganizerTodo()
        newTodo.setPriority(QOrganizerItemPriority.HighPriority)
        newTodo.setStatus(QOrganizerTodoProgress.StatusNotStarted)
        currentDateTime = QDateTime(QDate.currentDate(), QTime.currentTime())
        newTodo.setStartDateTime(currentDateTime)
        newTodo.setDueDateTime(currentDateTime.addSecs(60*60))

        self._todo = newTodo
        self._todo.isNewTodo = True
        self.currentTodoChanged.emit()
コード例 #3
0
    def reload(self):
        self._todos = []

        sortOrder = QOrganizerItemSortOrder()
        sortOrder.setDetailDefinitionName(QOrganizerTodoTime.DefinitionName,
                                          QOrganizerTodoTime.FieldDueDateTime)

        todoFilter = QOrganizerItemFilter()

        items = self.manager.items(todoFilter, [sortOrder])

        todos = []
        for item in items:
            if item.type() == QOrganizerItemType.TypeTodo:
                todo = QOrganizerTodo(item)

                display = todo.startDateTime().toString("yy/MM/dd hh:mm") +\
                        "-" + todo.dueDateTime().toString("yy/MM/dd hh:mm") +\
                        "\n" + todo.displayLabel()

                todos.append((display, todo))

        self._todos = todos
        self.todosChanged.emit()
コード例 #4
0
ファイル: qmltodo.py プロジェクト: AmerGit/Examples
    def reload(self):
        self._todos = []

        sortOrder = QOrganizerItemSortOrder()
        sortOrder.setDetailDefinitionName(QOrganizerTodoTime.DefinitionName,
                                          QOrganizerTodoTime.FieldDueDateTime)

        todoFilter = QOrganizerItemFilter()

        items = self.manager.items(todoFilter, [sortOrder])

        todos = []
        for item in items:
            if item.type() == QOrganizerItemType.TypeTodo:
                todo = QOrganizerTodo(item)

                display = todo.startDateTime().toString("yy/MM/dd hh:mm") +\
                        "-" + todo.dueDateTime().toString("yy/MM/dd hh:mm") +\
                        "\n" + todo.displayLabel()

                todos.append((display, todo))

        self._todos = todos
        self.todosChanged.emit()