[PyKDE] signals and slots

Boudewijn Rempt boud at rempt.xs4all.nl
Sat Oct 30 19:29:26 BST 1999


On 30 Oct 1999, Pete Ware wrote:

> Boudewijn Rempt <boud at rempt.xs4all.nl> writes:
> 
> > void setTitle ( const char *_title )  
> > 
> > self.connect(self.ilViewer, SIGNAL("setTitle (char)"), self.setTitle)
> > (or: elf.connect(self.ilViewer, SIGNAL("setTitle( const char *_title )"), self.setTitle))
> 
> It's
> 
> 	self.connect(self.ilViewer, SIGNAL("setTitle (const char*)"), self.setTitle)
> 
> (need the "const" and "*", don't need the parameter name).
> 

Perhaps there's something else wrong, then, since this doesn't appear
to solve the trouble:

Traceback (innermost last):
  File "./kurail.py", line 286, in ?
    main()
  File "./kurail.py", line 274, in main
    toplevel=kuraWin( app=app, parent=kapp)
  File "./kurail.py", line 196, in __init__
    self.view=KuraPanels(parent=self, app=self.app)
  File "./kurail.py", line 105, in __init__
    self.connect(self.ilViewer, SIGNAL("setTitle (const char*)"),
self.setTitle)
RuntimeError: Signal has wrong argument types for slot

Let alone that trying to put everything in but the parameter name 
worked for exotic parameters like KHTMLView... I'm kind of stuck now,
I use the KHTMLView to show a table and I've made every cell a link,
and I want my program to act upon clicks on cells - the standard
QTableView wasn't flexible enough. 

Has anyone else worked with KHTMLView? I suppose someone asked Phil
for it ;-). It's got a very funny little bug: if you make the window
taller, the horizontal scrollbar stays in place, and you can scroll
the text under the scrollbar... If you add

  def resizeEvent(self, e):
    self.calcScrollBars()
    KHTMLView.resizeEvent(self, e)

to a subclass of KHTMLView, the horizontal scrollbar moves correctly,
but the bottom-right corner suddenly is transparent, and you see the
page scrolling through it.

Boudewijn Rempt  | http://www.xs4all.nl/~bsarempt





More information about the PyQt mailing list