Пример #1
0
    def paint(self):
        """
            Defines how the main window looks like.
        """
        # Load tasks and create and add widgets.
        self.grid = QtGui.QGridLayout()
        self.taskVBox = QtGui.QVBoxLayout()

        tasks = ServerCommunicator.loadTasks()
        for task in tasks:
            self.addTask(task)

        # Buttons to edit your tasks.
        self.new = QtGui.QPushButton("New")
        self.new.clicked.connect(todoEvents.newEvent.__get__(self))

        self.grid.addLayout(self.taskVBox, 0, 1)
        self.grid.addWidget(self.new, 1, 1)

        self.setLayout(self.grid)
        self.move(300, 300)
        self.show()