[PyQt] QTableWidget - pyuic does not compile several attributes

Protopia pyqt4 at protopia.co.uk
Thu Jul 28 01:58:38 BST 2011


I am not sure whether anyone has found this problem before, however I
can't find it in the archives on Gmane.

 

I first came across this problem when I designed a table in QT Designer,
and set fonts on certain cells. But when I ran the code, no formatting.
Looking at the code generated by pyuic I could not see the code I would
expect to set the fonts.

 

So, I generated a test UI file in Designer with all properties on the
table widget, the vertical and horizontal titles and cells themselves
(attached)

 

And then I ran the compiler and looked at the code (attached) and found
the following things missing:

 

QTableWidget:

1.     .font.Kerning not compiled.

2.     .font.Antialiasing not compiled

3.     .QTableView.sortingEnabled is placed in reTranslateUI - however
this does not seem to be concerned with internationalisation and I feel
should be in the main code (though I could easily be wrong here)

4.     .QTableWidget.rowCount & .columnCount - if these are specified
explicitly in QT Designer then they appear twice in the .py file. (Of
course this won't cause major problems, but is nevertheless
inappropriate.)

 

QTableWidgetItem

1.     Horizontal and Vertical header tooltips, whatsthis, fonts,
textalign, background and foreground are not compiled at all.

2.     Cell tooltips, whatsthis, fonts and textalign are not compiled at
all.

3.     Cell background and foreground are compiled, however sequence of
statements is wrong - sets brush twice, then assigns second definition
to both background and foreground.

 

Whilst we are looking at this code, it would also be helpful if we were
to leave a blank line between code for QTableWidget, Horizontal Headers,
Vertical Headers and Cells.

 

Note: I am using python2.7.2 32-bit, and PyQt4.8.4-1 binary
PyQt-Py2.7-x86-gpl-4.8.4-1.exe.

 

P.S. I am trying to look at the uiparser.py and properties.py part of
the Pyqt4 uic compiler to see if I can work out how to fix this - but as
yet I have failed to understand the code well enough to work it out.

 

Rgds, P

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110728/50e715c7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestTableCompile.ui
Type: application/octet-stream
Size: 32444 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110728/50e715c7/attachment-0001.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestTableCompile.py
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110728/50e715c7/attachment-0001.ksh>


More information about the PyQt mailing list