#!/usr/bin/env python #coding: utf-8 import os import platform import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class AssignmentTab(QWidget): def __init__(self, parent=None): super(AssignmentTab, self).__init__(parent) self.assignmentsTable = QTableWidget() self.addAssignmentButton = QPushButton("Add assignment") self.editAssignmentButton = QPushButton("Edit assignment") self.assignmentDoneButton = QPushButton("Done") ## self.assignments = assignmentdata.AssignmentContainer() ## self.assignmentTable = QTableWidget() ## self.setCentralWidget(self.assignmentTable) ## vlayout = QVBoxLayout() hlayout = QHBoxLayout() hlayout.addWidget(self.addAssignmentButton) hlayout.addWidget(self.editAssignmentButton) hlayout.addWidget(self.assignmentDoneButton) vlayout.addWidget(self.assignmentsTable) vlayout.addLayout(hlayout) self.setLayout(vlayout) ## def updateTable(self, current=None): ## ## self.assignmentTable.clear() ## self.assignmentTable.setRowCount(len(self.assignments)) ## self.assignmentTable.setColumnCount(7) ## self.assignmentTable.setHorizontalHeaderLabels(["Date", "Course", "Description", "Available" , "Begun", "Finished", "Delivered"]) ## self.assignmentTable.setAlternatingRowColors(True) ## self.assignmentTable.setEditTriggers(QTableWidget.NoEditTriggers) ## self.assignmentTable.setSelectionBehavior(QTableWidget.SelectRows) ## self.assignmentTable.setSelectionMode(QTableWidget.SingleSelection) ## selected = None