aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/desktop/screenshot/screenshot.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/desktop/screenshot/screenshot.py')
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/widgets/desktop/screenshot/screenshot.py b/examples/widgets/desktop/screenshot/screenshot.py
index c818984dd..a5688da7a 100644
--- a/examples/widgets/desktop/screenshot/screenshot.py
+++ b/examples/widgets/desktop/screenshot/screenshot.py
@@ -5,7 +5,8 @@
import sys
-from PySide6.QtCore import QDir, QPoint, QRect, QStandardPaths, Qt, QTimer
+from PySide6.QtCore import (QDir, QPoint, QRect, QStandardPaths, Qt, QTimer,
+ Slot)
from PySide6.QtGui import QGuiApplication, QImageWriter
from PySide6.QtWidgets import (QApplication, QCheckBox, QDialog, QFileDialog,
QGridLayout, QGroupBox, QHBoxLayout, QLabel,
@@ -72,6 +73,7 @@ class Screenshot(QWidget):
if scaled_size != self.screenshot_label.pixmap().size():
self.update_screenshot_label()
+ @Slot()
def new_screenshot(self):
if self.hide_this_window_checkbox.isChecked():
self.hide()
@@ -79,6 +81,7 @@ class Screenshot(QWidget):
QTimer.singleShot(self.delay_spinbox.value() * 1000, self.shoot_screen)
+ @Slot()
def save_screenshot(self):
fmt = "png" # In order to avoid shadowing built-in format
initial_path = QStandardPaths.writableLocation(QStandardPaths.PicturesLocation)
@@ -127,6 +130,7 @@ class Screenshot(QWidget):
if self.hide_this_window_checkbox.isChecked():
self.show()
+ @Slot()
def update_checkbox(self):
if self.delay_spinbox.value() == 0:
self.hide_this_window_checkbox.setDisabled(True)