[PyQt] Those bl**dy signals again

Thomas Olsen tanghus at gmail.com
Sat Oct 3 11:17:27 BST 2009


Hi again

Caught in the trap again.

I have a Plasma.LineEdit [1] that I want to connect to a slot. Tried all of 
the calls below but nothing works.

        self.amount = Plasma.LineEdit()
        self.amount_validator = KFloatValidator(self.amount.nativeWidget())
        self.amount.nativeWidget().setValidator(self.amount_validator)
        self.amount.setText("1.0")

        # none of these calls does anything
        self.amount.connect(self.amount_editing_finished)
        self.amount.returnPressed.connect(self.amount_editing_finished)
        self.amount.editingFinished.connect(self.amount_editing_finished)
        QObject.connect(self.amount,SIGNAL("returnPressed()"),self.amount_editing_finished)
        QObject.connect(self.amount,SIGNAL("editingFinished()"),self.amount_editing_finished)

The slot is very simple:

    def amount_editing_finished()
        print "Amount editing finished"



[1] http://api.kde.org/4.x-api/kdelibs-
apidocs/plasma/html/classPlasma_1_1LineEdit.html

-- 
Best Regards / Med venlig hilsen

  Thomas Olsen



More information about the PyQt mailing list