[PyKDE] Missing signal?

Torsten Marek shlomme at gmx.net
Mon Apr 4 23:34:49 BST 2005


Eron Lloyd schrieb:
> Hi all,
> 
> I'm trying to connect to the overloaded method of QComboBox.activated(const 
> QString & string), but Qt complains that there's no such signal. Here is some 
> sample code:
> 
> from qt import *
> 
> app = QApplication([])
> vBox = QVBox()
> label = QLabel("Current Item", vBox)
> comboBox = QComboBox(vBox)
> comboBox.insertItem("One")
> comboBox.insertItem("Two")
> comboBox.insertItem("Three")
> app.setMainWidget(vBox)
> app.connect(comboBox, SIGNAL("activated(const QString & string)"), label,
>     SLOT("setText(const QString &)"))
> app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
> vBox.show()
> app.exec_loop()

Signals don't have names for the arguments, just types.
It must be
app.connect(comboBox, SIGNAL("activated(const QString&)"), label,
     SLOT("setText(const QString &)"))
-- 
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net




More information about the PyQt mailing list