def build(self): self.image1 = ImageWidget() self.image2 = ImageWidget() self.image3 = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.imageLayout.replaceWidget(self.ui.screen2, self.image2) self.imageLayout.replaceWidget(self.ui.screen4, self.image3) self.ui.screen1.deleteLater() self.ui.screen2.deleteLater() self.ui.screen4.deleteLater() self.ui.cbbWidth.setPlaceholderText("Width") self.ui.cbbHeight.setPlaceholderText("Height") self.ui.cbbWidth.setCurrentIndex(-1) self.ui.cbbHeight.setCurrentIndex(-1) frame_resize_values = [str(32 * i) for i in range(1, 20)] self.ui.cbbHeight.clear() for value in frame_resize_values: self.ui.cbbHeight.addItem(value, userData=int(value)) self.ui.cbbWidth.clear() for value in frame_resize_values: self.ui.cbbWidth.addItem(value, userData=int(value))
def build(self): self.image1 = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.ui.screen1.deleteLater() self.image_detect_left = ImageWidget() self.image_detect_right = ImageWidget() self.image_sample_left = ImageWidget() self.image_sample_right = ImageWidget() self.screen2_layout = self.ui.screen2.layout() self.screen2_layout.replaceWidget(self.ui.screen2Left, self.image_detect_left) self.screen2_layout.replaceWidget(self.ui.screen2Right, self.image_detect_right) self.ui.screen2Left.deleteLater() self.ui.screen2Right.deleteLater() self.screen3_layout = self.ui.screen3.layout() self.screen3_layout.replaceWidget(self.ui.screen3Left, self.image_sample_left) self.screen3_layout.replaceWidget(self.ui.screen3Right, self.image_sample_right) self.ui.screen3Left.deleteLater() self.ui.screen3Right.deleteLater() self.image_detect_left.ui.lblImage.setAlignment(Qt.AlignCenter) self.image_detect_right.ui.lblImage.setAlignment(Qt.AlignCenter) self.image_sample_left.ui.lblImage.setAlignment(Qt.AlignCenter) self.image_sample_right.ui.lblImage.setAlignment(Qt.AlignCenter) return
def build(self): self.image1 = ImageWidget() self.image2 = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.imageLayout.replaceWidget(self.ui.screen2, self.image2) self.ui.screen1.deleteLater() self.ui.screen2.deleteLater()
def build(self): self.image1 = ImageWidget() self.image2 = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.imageLayout.replaceWidget(self.ui.screen2, self.image2) self.image1.ui.lblImage.setAlignment(Qt.AlignCenter) self.image2.ui.lblImage.setAlignment(Qt.AlignCenter) self.ui.screen1.deleteLater() self.ui.screen2.deleteLater()
def build(self): self.image1 = ImageWidget() self.image2 = ImageWidget() self.image3 = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.imageLayout.replaceWidget(self.ui.screen2, self.image2) self.imageLayout.replaceWidget(self.ui.screen3, self.image3) self.ui.screen1.deleteLater() self.ui.screen2.deleteLater() self.ui.screen3.deleteLater() self.ui.cbbWidth.setPlaceholderText("Width") self.ui.cbbHeight.setPlaceholderText("Height") self.ui.cbbCamera.setPlaceholderText("Choose Cam") self.ui.cbbCamera.clear() for camera in self.__cam_array: self.ui.cbbCamera.addItem("Camera " + str(camera), userData=camera) frame_resize_values = [ "160", "240", "320", "400", "480", "560", "640", "720", "800", "880", "960", "1040", "1120", "1200", "1280" ] self.ui.cbbHeight.clear() for value in frame_resize_values: self.ui.cbbHeight.addItem(value, userData=int(value)) self.ui.cbbWidth.clear() for value in frame_resize_values: self.ui.cbbWidth.addItem(value, userData=int(value)) self.ui.cbbMethod.clear() self.ui.cbbMethod.addItem("Edge", userData="edge") self.ui.cbbMethod.addItem("Threshold", userData="thresh") self.ui.cbbMethod.addItem("Range", userData="range") table = self.ui.tblCameraConfig table.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch) table.horizontalHeader().setSectionResizeMode( 1, QHeaderView.ResizeToContents) table.setEditTriggers(QAbstractItemView.NoEditTriggers) table.setContextMenuPolicy(Qt.CustomContextMenu) self.__reload_table() # create context menu self.tblPopMenu = QMenu(self) self.tblPopActionEditName = QAction('Edit name', self) self.tblPopActionRemove = QAction('Remove', self) self.tblPopMenu.addAction(self.tblPopActionEditName) self.tblPopMenu.addAction(self.tblPopActionRemove)
def build(self): self.image1 = ImageWidget() self.side_result_image = ImageWidget() self.left_detected_image = ImageWidget() self.right_detected_image = ImageWidget() self.left_sample_image = ImageWidget() self.right_sample_image = ImageWidget() self.imageLayout = self.ui.screen1.parentWidget().layout() self.imageLayout.replaceWidget(self.ui.screen1, self.image1) self.ui.screen1.deleteLater() self.mainCamLayout = self.ui.mainResult.layout() self.mainCamLayout.replaceWidget(self.ui.detected_L, self.left_detected_image) self.mainCamLayout.replaceWidget(self.ui.detected_R, self.right_detected_image) self.mainCamLayout.replaceWidget(self.ui.sample_L, self.left_sample_image) self.mainCamLayout.replaceWidget(self.ui.sample_R, self.right_sample_image) self.ui.detected_L.deleteLater() self.ui.detected_R.deleteLater() self.ui.sample_L.deleteLater() self.ui.sample_R.deleteLater() self.sideCamLayout = self.ui.sectionSideResult.layout() self.sideCamLayout.replaceWidget(self.ui.lblSideResult, self.side_result_image) self.ui.lblSideResult.deleteLater()