-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathimage_config.py
More file actions
33 lines (28 loc) · 1.16 KB
/
Copy pathimage_config.py
File metadata and controls
33 lines (28 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from PySide2.QtWidgets import QDialog
from PySide2.QtGui import Qt
from PySide2.QtCore import Signal
from ui.yuvconfig import Ui_YUVConfig
from components.BasicImage import YuvParam
class YUVConfig(QDialog):
format = YuvParam()
need_saveimg_in_rotate = True
configUpdateEvent = Signal()
def __init__(self, parent=None) -> None:
super().__init__(parent)
self.ui = Ui_YUVConfig()
self.ui.setupUi(self)
self.ui.buttonBox.clicked.connect(self.get)
def set(self):
self.ui.width.setValue(self.format.width)
self.ui.height.setValue(self.format.height)
index = self.ui.yuvformat.findText(self.format.yuv_format)
self.ui.yuvformat.setCurrentIndex(index)
self.ui.saveimg_in_rotate.setCheckState(
Qt.Checked if self.need_saveimg_in_rotate else Qt.Unchecked)
def get(self):
self.format.height = self.ui.height.value()
self.format.width = self.ui.width.value()
self.format.yuv_format = self.ui.yuvformat.currentText()
self.need_saveimg_in_rotate = (
self.ui.saveimg_in_rotate.checkState() == Qt.Checked)
self.configUpdateEvent.emit()