[PyQt] QTableWidget Desperation!
Lawrence Shafer
detroit371 at gmail.com
Sat Nov 24 05:01:10 GMT 2007
OK, I'm a total ID10T! Two more lines did it! just when you give up
after 3 hrs of struggle, it all comes together!
Sorry!
additional code;
========================
item = QtGui.QTableWidgetItem("simple text")
self.tableWidget.setItem(0, 0, item)
Lawrence Shafer wrote:
> I am trying to get the QTableWidget figured out. So far, adding data
> to the cells doesn't seem straightforward. I can't seem to find a good
> solid example that is simple, maybe because it's not simple! This is
> what I have so far, can you just give me an example of how to put
> simple text into one cell??? I really don't want to have to mess with
> what seems to be the complicated way the ships-dict example from marks
> book does it. I just need something super-simplified!
>
> Many Thanks!
>
> Lawrence
>
>
> working code so far,
> =======================
> def updateTable(self):
> self.tableWidget.showGrid()
> self.tableWidget.setRowCount(20)
> self.tableWidget.setColumnCount(7)
> headers=["Start Time", "Stop Time", "Total Time", "Hourly
> Rate", "Parts", "Total $", "Notes"]
> self.tableWidget.setHorizontalHeaderLabels(headers)
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
More information about the PyQt
mailing list