[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] QTableWidget vs. QTableView
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2006-06-20 14:21:41
Message-ID: 20060620142141.GE12263 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]

On 20.06.06 15:15:05, bastian salmela wrote:
> 
> I'm trying to create my own subclass from QTableWidget, but no matter what I 
> try, I always end up with just white blank area, no table grid at all. I then 
> tried to create it from QTableView and it works. 
> is this QT or PyQT bug? or am I just doing it wrong? 
> here is simply how I had it subclassed with QTableWidget (just for testing).. 
> shouldn't that already display atleast something? 
> class bbVuoroTaulu(QtGui.QTableWidget):
>   def __init__(self, parent=None):
> 	QtGui.QTableWidget.__init__(self, parent)
> 	self.setRowCount(8)
> 	self.setColumnCount(2) 

The following code works perfectly here:

>>> from PyQt4.QtGui import QApplication,QTableWidget
>>> import sys
>>> class mytable(QTableWidget):
...   def __init__(self, parent=None):
...     QTableWidget.__init__(self, parent)
...     self.setRowCount(8)
...     self.setColumnCount(2)
...
>>> app=QApplication(sys.argv)
>>> t=mytable()
>>> t.show()
>>> app.exec_()

Shows a table with 2 columns and 8 rows. I think the error is somewhere
else in the rest of your code...

Andreas

-- 
You will be surprised by a loud noise.

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic