[PyKDE] Totally stuck on QTableWidget conversion

Dave S eric3 at pusspaws.net
Tue Oct 3 20:35:03 BST 2006


In a word HELP .... :)

I am soooo stuck converting my QT3 app to windows QT4. I have managed to get 
almost everything done except QTable

I was using QTable and QTableItem. I am now trying to implement QTableWidget & 
QTableWidgetItem but have the following problems ...

(1)  I used to use self.tableitem.setSpan(2,2) to join 2 X rows together in 
QT3 I then wrote text in a large font with a different coloured background to 
differentiate different sections of my QTable.

Googling I found 

http://lists.trolltech.com/qt4-preview-feedback/2006-09/thread00172-0.html

So setSpan() still exists in QT4 but apparently not in PyQt() ? I have read & 
re-read the docs (got headache - got asprin!)  Is there an alternative ?


(2) I used to use self.table1.setColumnStretchable(0, 1) to fill my QTable no 
matter what size. I Have googled and found a reference or two but no-one 
seems to know how to replace it. 

At the moment I am thinking about a bodge of ... signal: re-size 
QTableWidget -> slot: get QTableWidget size -> calculate and re-size columns 
but there has to be a better way -  any suggestions ?

To me (novice programmer :)) QT4 seems quite a challenge after QT3 - however I 
need to use QT4 due to the GPL licence on Windows.

Any help greatly appreciated.

If it helps I can attach a jpeg of my QT3 app to show you guys what I am 
trying to achieve with QT4 - I have not attached it here because I would 
guess its against list rules.

Cheers

Dave












(2) I used to use self.table1.setColumnStretchable() to make my columns fill 
the available space




More information about the PyQt mailing list