0

I'm using the subprocess function in order to open a Qt windows and I would like display a dialogbox (saying wait a minute for instance) that appear only the time for MyWindow is taking to be completely open. I use that line to open my Qt window:

subprocess.Popen([sys.executable, "MyWindow.py"])

But I have no idea of how I can get a signal that MyWindow is open and so I could closed the qdialogue box in the first program (from which the subprocess is called).

Any idea?

m7913d
  • 10,244
  • 7
  • 28
  • 56
ymmx
  • 4,769
  • 5
  • 32
  • 64
  • What is the point of using `subprocess`? Just import *MyWindow.py* and open the window normally. – ekhumoro Dec 01 '17 at 18:54
  • Because for now I run .py script but in the end I will launch .exe. When so, I could not import MyWindows directly. – ymmx Dec 04 '17 at 15:10
  • Why can't you import it? Please edit your question and explain more clearly what you are trying to achieve, and make sure you include **all** the relevant information. – ekhumoro Dec 04 '17 at 15:14

1 Answers1

0

not sure about qt much, i am sure you must have gone through below link where users have faced similar problems

https://forum.qt.io/topic/6386/how-can-i-check-if-qmainwindow-is-fully-loaded

two things i can suggest

1) either use sleep to wait

2) you can use win32 api for python , which gives few controls over the window gui (get title,handle id) bases on your gui , you can play with the API and see if you can put some conditional wait. here is one of many link on that topic

Get the title of a window of another program using the process name

pankaj mishra
  • 2,555
  • 2
  • 17
  • 31