File: get_resolution.py

package info (click to toggle)
python-pyqtgraph 0.13.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,520 kB
  • sloc: python: 52,773; makefile: 115; ansic: 40; sh: 2
file content (19 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from .. import mkQApp
from ..Qt import QtGui


def test_screenInformation():
    # a qApp is still needed, otherwise screen is None
    qApp = mkQApp()  # noqa
    screen = QtGui.QGuiApplication.primaryScreen()
    screens = QtGui.QGuiApplication.screens()
    resolution = screen.size()
    availableResolution = screen.availableSize()
    print("Screen resolution: {}x{}".format(resolution.width(), resolution.height()))
    print("Available geometry: {}x{}".format(availableResolution.width(), availableResolution.height()))
    print("Number of Screens: {}".format(len(screens)))
    return None


if __name__ == "__main__":
    test_screenInformation()