[PyKDE] Remaining issues with PyQt

Boudewijn Rempt boud at rempt.xs4all.nl
Thu Sep 13 16:51:22 BST 2001


I've very nearly finished all the text for my book (just have to 
do the intro on BlackAdder, a bit on compiling PyQt and some appendices),
and I am making a list of things that don't quite work as they should,
remain to be done or will be resolved in the Qt3 version of PyQt.

Before I touch up the text using these notes, I'd like comments 
on them:

* If a QString contains characters that are not in the ASCII character set,
  it is necessary to hack around with 
	sys.setappdefaultencoding=sys.setdefaultencoding 
  and stuff - not really comfortable.

* The  boolean decode(mimesource, string) should put the text in the string, so 
   it should return a tuple in Python: 
           (bool, string) = QTextDrag.decode(mimesource), as done in 
   QFontDialog.

* You cannot actually put something in or get something out of Qt's stream
  classes, like QTextStream (<< and >> not implemented or implementable).

* the tr() method doesn't work in PyQt versions based on Qt < 3 - there's
  a hack around, namelijk implementing a 
   def tr(self, *args):
	apply(qApp.translate,("widgetName",) + *args)

* Some methods from the base QObject class use QObject instead of a     
  higher-level class, like className(). In PyQt 2.5 this works very well:

    >>> from qt import *
    >>> t=QTimer()
    >>> print t.className()
    QTimer

  However, when you try to do the same from a Python subclass, you get
  referred back to QObject:

    >>> from qt import *
    >>> class A(QTimer): pass
    ...
    >>> a = A()
    >>> print a.className()
    QObject
    
* Cannot remove or replace widgets in layouts. (Using a widgetstack is not
  always the answer).

* QLayoutIterator - I'm not not sure what the status on this is.


-- 

Boudewijn Rempt | http://www.valdyas.org 




More information about the PyQt mailing list