SOLVED: No signals from Plasma.ComboBox?
Thomas Olsen
tanghus at gmail.com
Thu Oct 1 16:53:10 CEST 2009
On 30/9-2009 14:09 Thomas Olsen <tanghus at gmail.com> wrote:
> Hi
>
> Firstly, it has been *AGES* since I've coded Qt/KDE and this is my first
> endeavor into Plasma so I'll probably be sending a lot of newbie questions,
> but I'll promise that I'll do my best to google for the answers first.
>
> I'm trying to connect the activated or textChanged from a Plasma.ComboBox
> signal to a Python function but nothing seems to happen. This is what I've
> tried inside my init() function (most is snipped out):
>
> self.currency_to = Plasma.ComboBox(self.applet)
>
> QObject.connect(self.currency_from,SIGNAL("activated(PyQt_PyObject)"),self
> .do_convert_from)
>
> def do_convert_from(currency_from):
> print "Convert from:" + currency_from
>
> But when I select an item in the combo nothing happens; no errors or
> anything.
>
> I've also tried:
>
>
> QObject.connect(self.currency_from,SIGNAL("activated(string)"),self.do_con
> vert_from)
>
> but to no avail.
>
> If anyone can point me to a Python Plasmoid I can study I would appreciate
> it.
>
Well I couldn't figure out how to use the new style signal/slots stuff but
aseigo was closest - it just had to be a bit more explicit :-)
QObject.connect(self.currency_from,SIGNAL("textChanged(const QString &)"),
self.do_convert_from)
--
Best Regards / Med venlig hilsen
Thomas Olsen
More information about the Plasma-devel
mailing list