[Eric] Fwd: Event Handling from a second Form

Detlev Offenbach detlev at die-offenbachs.de
Thu Jun 19 15:09:26 BST 2014



On Wednesday 18 June 2014, 16:57:03 accounts wrote:
> Hi Guys,
> 
> I am super new to PyQT ... I am using QT Designer for my forms. I am
> confused about where to put my event handling for the second form in my
> project.
> 
> I have the following .py files :
> 
> *main.py*
> *Ui_make_render_folders.py* (generated from the Qt designer ui file)
> *Ui_prefs.py* (generated from the Qt designer ui file)
> *Mainwindow.py* (this is where all the even handling for the main form
> lives)
> *icons_rc.py* (resource file)
> *make_render_folders.py* (where all my custom functions live)
> 
> Here is a picture of the script running :
> my_script_running
> <http://www.qtforum.org/index.php?page=ExternalLink&url=https%3A%2F%2Fwww.dr
> opbox.com%2Fs%2Fd4r22rb4shvptvc%2Frender_folder_gen.JPG>
> 
> 
> My question is ... where does the even handling for my prefs window go ????
> I cant figure out where to put my *on_btn_released() for the buttons on y
> 2nd form.* Also I am not sure I am instantiating that dialog properly.
> Currently I am adding this code to the top of my MainWindow.py.

I'd recommend to place it in a prefs.py file to keep it separate from the main window. In eric I am 
always placing forms lofic in a file named after the .ui file, just with a .py extension.

> 
> Finally what does @pyqSignature("") do ? And do I need it ?

It tells PyQt the signature of the slot and you need it most times and makes the code clearer.

Detlev
-- 
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140619/43f2cc5d/attachment.html>


More information about the Eric mailing list