aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/desktop/screenshot/screenshot.py
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2022-09-01 08:15:19 +0300
committerSimo Fält <simo.falt@qt.io>2022-09-01 08:15:19 +0300
commit789fc5d65d2e0ba95cda25e63f74dd4def87a775 (patch)
tree28019fcbb368b64fad68d930a2587ee22092d71b /examples/widgets/desktop/screenshot/screenshot.py
parent54a301d83910a760ff7f7aa5bea1e3c3d7226bc8 (diff)
parent0ad10f40c9cdbe6d054b6e7ffd60d14846a1d4aa (diff)
Merge remote-tracking branch 'origin/6.3' into wip/6.3_pypy
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 19aa4c354..529f35bba 100644
--- a/examples/widgets/desktop/screenshot/screenshot.py
+++ b/examples/widgets/desktop/screenshot/screenshot.py
@@ -42,7 +42,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,
@@ -109,6 +110,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()
@@ -116,6 +118,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)
@@ -164,6 +167,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)