2

I'm working with PyQt5 and I'd like to have my ui open on the left half of the screen with a PDF viewer (like foxit or adobe reader) on the right side of the screen. I know that maximize() will cause one window to fill the entire screen. Also, I know that I could open the two windows using exact pixel locations and that would work for most screen. However, is there a function that would 'snap' my PyQt application and a pdf viewer side by side for easy reading?

I'm working on windows 10

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Lacrosse343
  • 491
  • 1
  • 3
  • 18
  • I suspect you'll have to use pywin32 to make api calls to resize windows. [This post](https://stackoverflow.com/a/31629259/9705687) shows how to find, move, and resize windows. – bfris Jun 08 '20 at 18:10

1 Answers1

1

There is no method as specific as the one you require, the solution is to establish the geometry using the existing methods:

# ...
r = QGuiApplication.primaryScreen().geometry()
r.setSize(QSize(0.5 * r.width(), r.height()))
your_window.setGeometry(r)
# ...
eyllanesc
  • 235,170
  • 19
  • 170
  • 241