-
Notifications
You must be signed in to change notification settings - Fork 0
/
addborder.py
115 lines (106 loc) · 5.77 KB
/
addborder.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'addborder.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_addborder(object):
def setupUi(self, Dialog_addborder):
Dialog_addborder.setObjectName("Dialog_addborder")
Dialog_addborder.resize(400, 200)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Dialog_addborder.sizePolicy().hasHeightForWidth())
Dialog_addborder.setSizePolicy(sizePolicy)
Dialog_addborder.setMinimumSize(QtCore.QSize(400, 200))
Dialog_addborder.setMaximumSize(QtCore.QSize(400, 200))
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog_addborder)
self.buttonBox.setGeometry(QtCore.QRect(310, 20, 81, 241))
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.widget = QtWidgets.QWidget(Dialog_addborder)
self.widget.setGeometry(QtCore.QRect(10, 21, 281, 179))
self.widget.setObjectName("widget")
self.gridLayout = QtWidgets.QGridLayout(self.widget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(self.widget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.comboBox = QtWidgets.QComboBox(self.widget)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 4)
self.label_2 = QtWidgets.QLabel(self.widget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.spinBox_top = QtWidgets.QSpinBox(self.widget)
self.spinBox_top.setObjectName("spinBox_top")
self.gridLayout.addWidget(self.spinBox_top, 1, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.widget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.spinBox_bottom = QtWidgets.QSpinBox(self.widget)
self.spinBox_bottom.setObjectName("spinBox_bottom")
self.gridLayout.addWidget(self.spinBox_bottom, 2, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(self.widget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.spinBox_left = QtWidgets.QSpinBox(self.widget)
self.spinBox_left.setObjectName("spinBox_left")
self.gridLayout.addWidget(self.spinBox_left, 3, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(self.widget)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1)
self.spinBox_right = QtWidgets.QSpinBox(self.widget)
self.spinBox_right.setObjectName("spinBox_right")
self.gridLayout.addWidget(self.spinBox_right, 4, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.widget)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 5, 0, 1, 2)
self.spinBox_red = QtWidgets.QSpinBox(self.widget)
self.spinBox_red.setMaximum(255)
self.spinBox_red.setObjectName("spinBox_red")
self.gridLayout.addWidget(self.spinBox_red, 5, 2, 1, 1)
self.spinBox_green = QtWidgets.QSpinBox(self.widget)
self.spinBox_green.setMaximum(255)
self.spinBox_green.setObjectName("spinBox_green")
self.gridLayout.addWidget(self.spinBox_green, 5, 3, 1, 1)
self.spinBox_blue = QtWidgets.QSpinBox(self.widget)
self.spinBox_blue.setMaximum(255)
self.spinBox_blue.setObjectName("spinBox_blue")
self.gridLayout.addWidget(self.spinBox_blue, 5, 4, 1, 1)
self.retranslateUi(Dialog_addborder)
self.buttonBox.accepted.connect(Dialog_addborder.accept)
self.buttonBox.rejected.connect(Dialog_addborder.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog_addborder)
def retranslateUi(self, Dialog_addborder):
_translate = QtCore.QCoreApplication.translate
Dialog_addborder.setWindowTitle(_translate("Dialog_addborder", "Add Border"))
self.label.setText(_translate("Dialog_addborder", "Border Type"))
self.comboBox.setItemText(0, _translate("Dialog_addborder", "cv2.BORDER_CONSTANT"))
self.comboBox.setItemText(1, _translate("Dialog_addborder", "cv2.BORDER_REFLECT"))
self.comboBox.setItemText(2, _translate("Dialog_addborder", "cv2.BORDER_REFLECT_101"))
self.comboBox.setItemText(3, _translate("Dialog_addborder", "cv2.BORDER_WRAP"))
self.comboBox.setItemText(4, _translate("Dialog_addborder", "cv2.BORDER_REPLICATE"))
self.label_2.setText(_translate("Dialog_addborder", "Top"))
self.label_3.setText(_translate("Dialog_addborder", "Bottom"))
self.label_4.setText(_translate("Dialog_addborder", "Left"))
self.label_5.setText(_translate("Dialog_addborder", "Right"))
self.label_6.setText(_translate("Dialog_addborder", "Border Color (RGB)"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog_addborder = QtWidgets.QDialog()
ui = Ui_Dialog_addborder()
ui.setupUi(Dialog_addborder)
Dialog_addborder.show()
sys.exit(app.exec_())