[PyKDE] Connect syntax.
    Sundance 
    sundance at ierne.eu.org
       
    Wed Sep 22 19:11:37 BST 2004
    
    
  
I heard Phil Thompson said:
> I have a policy of not (if at all possible) changing or "enhancing"
> the API.
C++ Qt:
SomeWidget::SomeWidget () {
  // ...
  connect (this,         SIGNAL("whatever()"),        // <-- look!
           otherWidget,  SLOT("blah()"));
  // ...
}
Current PyQt:
class SomeWidget(QWidget):
  def __init__(self):
    # ...
    SELF.connect (self,         SIGNAL("whatever()"),  # <-- look!
                  otherWidget,  SLOT("blah()"))
    # ...
Keeping the same API as C++ Qt is in fact what I was suggesting. :) The 
Qt API is /damn/ good. In this case as in others, I'd rather see the Qt 
API adapted faithfully than bent slightly under one of Python's 
idiosyncrasies.
Point taken about making connect an instance method, however.
-- S.
    
    
More information about the PyQt
mailing list