[PyQt] Working with sub-windows

Alain Muls alain.muls at gmail.com
Fri Jan 19 09:30:42 GMT 2018


Hi All

I am working on a pyqt script that next to a mainwindow opens several 
separate sub windows. A worker script is running in a separate thread 
and sends signals which connect to different slots. These slots can be 
located in sub-windows which are not necessarily created at the instance 
the signal-slot connection is made.

A problem arises for which I would get a correct solution (I circumvent 
them for now):

  * to avoid a problem with the signal-slot connection I do a test on
    the sub-window, which I initialize to None at startup, before
    connecting, doing

    if subWindow is not None:
         connect signal to slot

    If I open the window I create the connection from the MainWindow,
    but here I have to check whether the worker script is already active
    (done by opening a file) for which I also perform an init to None
    and a similar check.

    Now I wonder what happens when I close the sub-window, will its
    value ecome None again ?
    Also, from whatever side I try to create the connection, I perform a
    check on something else being 'None' and I think this is not the
    correct approach.

Tx for your help
Alain


-- 

	
*Alain Muls*
/Professor/
Department CISS
*Royal Military Academy*
p: 	+32 244 13936
a: 	Renaissance Avenue 30
	B1000 Brussels (Belgium)
w: 	www.rma.ac.be/ciss/en/ <http://www.rma.ac.be/ciss/en/> e: 
alain.muls at rma.ac.be <mailto:alain.muls at rma.ac.be>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180119/53896bce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logorma-transparent-scaled.png
Type: image/png
Size: 3940 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180119/53896bce/attachment.png>


More information about the PyQt mailing list