0

I am writing an app using pyQt. Basically I am using the pyQt part of the app for user interaction and then use

subprocess.Popen(["pdf.exe","output.pdf"])

to show the file that my program generated. But there is a problem: the pdf.exe is not bound in any way to the main app, so switching focus from the app and back to it wouldn't also bring pdf.exe to the front.

Possible solutions:

1)Bring app to front through some command each time the main one gains focus. (I don't know how.)

2)Use some very clever pyQt thing, that will bundle these two apps together. (I don't know how.)

RuRo
  • 311
  • 4
  • 17
  • 1
    See [Handling PDF](http://qt-project.org/wiki/Handling_PDF) on the Qt Wiki. – ekhumoro Jan 25 '15 at 17:47
  • @ekhumoro would poppler-Qt4 or muPDF work with pyQt, though? – RuRo Jan 25 '15 at 19:28
  • 1
    Are you unable to search for [things](https://github.com/wbsoft/python-poppler-qt4/blob/master/demo.py) yourself? – ekhumoro Jan 25 '15 at 21:20
  • @ekhumoro it didn't work for me, when I tried to instal it, I had an error about some file missing and on the forums I was told that poppler is too outdated and won't work with newer versions of pyQt4. Anyway my question was about window focus in the first place, not about displaying pdf in pyQt. – RuRo Jan 26 '15 at 03:02

0 Answers0