Esempio n. 1
0
    def __init__(self, width, height, parent = None):
        super(ApHlasConfDlg, self).__init__(parent)
        
        table1 = QTableWidget(5, 5)
        table1.connect(table1, SIGNAL("cellActivated(int, int)"), self.showTags)
        table1.connect(table1, SIGNAL("cellClicked(int, int)"), self.showTags)
        it1 = QTableWidgetItem("Hello")
        table1.setItem(0, 0, it1)

        hdview = QHeaderView(Qt.Horizontal)
        hdview.setStretchLastSection(True)
        self.tagsTable = QTableWidget(5,1)
        self.tagsTable.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
        self.tagsTable.setHorizontalHeader(hdview)
        self.tagsTable.setHorizontalHeaderLabels(['tags'])
        l = QHBoxLayout(self)
        l.addWidget(table1)
        l.addWidget(self.tagsTable)
Esempio n. 2
0
    def createLogView(self, vbox):
        self.logView=QTableView(self)
        vbox.addWidget(self.logView)
        
        self.logViewModel=CANLogViewTableModel(self.logBuffer, self.canIdList, self)
        self.logView.setModel(self.logViewModel)
        
        header=QHeaderView(Qt.Horizontal, self.logView)
        header.setStretchLastSection(True)
        header.setResizeMode(NUMBER_COL, QHeaderView.Fixed)
        header.setResizeMode(TIME_COL, QHeaderView.Fixed)
        header.setResizeMode(ID_COL, QHeaderView.Fixed)

        self.logView.setHorizontalHeader(header)
        
        self.logView.setColumnWidth(NUMBER_COL, 80)
        self.logView.setColumnWidth(TIME_COL, 150)
        self.logView.setColumnWidth(ID_COL, 80)
        self.logView.setColumnWidth(SIZE_COL, 50)