Skip to content

ScreenCapture

Qt Base Class: QScreenCapture

Signature: QScreenCapture(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QScreenCapture
PySide6.QtMultimedia
QScreenCapture(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473573990976["multimedia.ScreenCapture"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473573920704["QtMultimedia.QScreenCapture"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473573990976
  140713234304496 --> 1473299815024
  1473573920704 --> 1473573990976
  1473288842240 --> 1473573920704
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QScreenCapture

Source code in prettyqt\multimedia\screencapture.py
class ScreenCapture(core.ObjectMixin, QtMultimedia.QScreenCapture):
    def get_error(self) -> ErrorStr:
        """Return error type.

        Returns:
            error type
        """
        return ERROR.inverse[self.error()]

    def set_screen(self, screen: int | gui.QScreen | Literal["primary"]):
        match screen:
            case int():
                screen = gui.GuiApplication.screens()[screen]
            case gui.QScreen():
                pass
            case "primary":
                screen = gui.GuiApplication.primaryScreen()
            case _:
                raise TypeError(screen)
        self.setScreen(screen)

get_error() -> ErrorStr

Return error type.

Source code in prettyqt\multimedia\screencapture.py
def get_error(self) -> ErrorStr:
    """Return error type.

    Returns:
        error type
    """
    return ERROR.inverse[self.error()]

⌗ Property table

Qt Property Type Doc
objectName QString
active bool
screen QScreen
error QScreenCapture::Error
errorString QString