[PyKDE] Abstract Table Model + TableView

Kelly Burkhart kelly.burkhart at gmail.com
Wed Jan 31 01:10:53 GMT 2007


That works perfectly.  Thanks!

-K

On 1/30/07, David Boddie <david at boddie.org.uk> wrote:
> On Tue Jan 30 23:45:23 MET 2007, Kelly Burkhart wrote:
>
> > I'm experimenting with QAbstractTableModel + QTableView and having a
> > difficult time getting what I expect.  I'm hoping with the attached
> > code to create a grid with a header and each cell showing some text.
> > Instead I'm getting a grid with no header (tableview.header().show()
> > has no effect) and cells that look like check box widgets.
> >
> > Can anyone spot some obvious problems with my code?
>
> Yes, you're returning QVariants containing empty strings when you mean
> to return invalid QVariants. Change all occurrences of QVariant('') to
> QVariant() and it should work as you expect.
>
> > With QTableView does one have to manually create header and enable
> > column resizing?  Or is there some hidden switch that I'm not touching
> > that enables this functionality?
>
> It should just work. There are some subtleties with expanding columns
> and rows to optimize the space allocated to items - just ask again if
> you encounter problems along those lines.
>
> David
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_tv.py
Type: text/x-python
Size: 2177 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070131/3c545a58/tst_tv.py


More information about the PyQt mailing list