[Eric] How can I use custom slots in Eric4/qtdesigner

Jeroen Eitjes jeroen.eitjes at gmail.com
Tue Mar 22 14:43:55 GMT 2011


Hi,

I am new to Eric4 and I have a problem. I have designed a userinterface for
an app in qtdesigner via eric4.

I have a button in this design. I am trying to connect the clicked() signal
of this button to a custom slot. I want to be able to run some python code
when the button is clicked.
So I tried the following:

1. Place the button on the main form (qtdesigner)
2. Right-click on the form and choose the option "Change Signals/slots"
3. In the Signal/slots form I click on the + of the Slots to add a custom
slot
4. I name the custom slot "on_pushRetrieveBackupBrowser_clicked()" and click
OK
5. I go to the Signal/Slot editor and connect pushRetrieveBackupBrowse
clicked() signal to mainWindow.on_pushRetrieveBackupBrowser_clicked()
6. I Save the file in qtdesigner and go to Eric4
7. I choose compile all in Eric4, which works
8. I choose "Generate Dialog Code" to get a subclass. This gives an error
message: "QMainWindow object has no attribute
on_pushRetrieveBackupBrowser_clicked"

This is my problem.

What am I doing wrong? How can I have code executed when a button is
clicked?

Thanks,

Jeroen Eitjes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20110322/dc38e847/attachment.html>


More information about the Eric mailing list