Source code for sksurgeryutils.utils.screen_utils

# coding=utf-8
""" Any useful utilities relating to displays/screens. """
#pylint:disable=no-name-in-module

from PySide2.QtGui import QGuiApplication

#pylint: disable=useless-object-inheritance


[docs]class ScreenController(object): """ This class detects the connected screens/monitors, and returns the primary screen and a list of any secondary screens. """ def __init__(self): self.screens = QGuiApplication.screens() self.primary = QGuiApplication.primaryScreen() if self.primary in self.screens: self.screens.remove(self.primary)
[docs] def list_of_screens(self): # pylint: disable=no-self-use """Return the primary screen and list of other available screens""" return self.primary, self.screens