[PyKDE] [PyQt] QTabBar and missing signals
Boudewijn Rempt
boud at valdyas.org
Tue Nov 13 11:44:20 GMT 2001
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 14 November 2001 11:27, Alessandro Gatti wrote:
> Hi there,
>
> I'm currently writing a simple application using PyQt 2.5 and I'm stuck
> trying to understand what I'm doing wrong regarding QTabBar.
>
> After constructing the tabBar and adding the necessary tabs, I attempted
> to connect the selected() signal that QTabBar emits to my own
> application in order to show the right QDialog on a particular QWidget.
>
> The connecting code is:
> QObject.connect(self.tabBar, SIGNAL('selected()'), self, \
> SLOT('repaintWindow()'))
> [ where repaintWindow() is a function I wrote. ]
>
> When I run that code, my QDialogs aren't shown and I get this error on
> the console:
>
> QObject::connect: No such signal QTabBar::selected()
> QObject::connect: (sender name: 'unnamed')
> QObject::connect: (receiver name: 'unnamed')
>
> I looked up the documentation and QTabBar::selected() *does* exist
> there...
Not in my copy of Qt - there's only selected(ind d). So you should
try:
QObject.connect(self.tabBar, SIGNAL('selected(int)', self.repaintWindow)
(No need to wrap your Python slot functions in SLOT().)
repaintWindow then should expect the argument, of course.
- --
Boudewijn Rempt | http://www.valdyas.org
public key at: certserver.pgp.com or pki.surfnet.nl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE78PknN8fj6DnPxOgRAovBAKCUokH1nwWhZGP4AV8P5or7VhwzOACdGX1S
RmF+j7KaHPrMAUWswe5o8I0=
=SIst
-----END PGP SIGNATURE-----
More information about the PyQt
mailing list