Пример #1
0
    def test_isCompleted_sub(self):
        todo = ToDo()
        self.assertEqual(todo.isCompleted(), False)

        todo.setCompleted()
        self.assertEqual(todo.isCompleted(), True)

        child = todo.addSubtodo(ToDo())
        self.assertEqual(todo.isCompleted(), False)

        child.setCompleted()
        self.assertEqual(todo.isCompleted(), True)
        self.assertEqual(child.isCompleted(), True)
Пример #2
0
def get_todo_fgcolor( todo: ToDo ) -> QBrush:
    if todo.isCompleted():
        ## completed -- green
        return QBrush( get_completed_color() )
    ## normal
    return QBrush( QColor(0, 0, 0) )
Пример #3
0
    def test_isCompleted(self):
        todo = ToDo()
        self.assertEqual(todo.isCompleted(), False)

        todo.setCompleted()
        self.assertEqual(todo.isCompleted(), True)