From 8e2fdcef4c149f1c2b57e15295e20d9c9a0116d8 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sat, 4 Feb 2023 16:27:26 +0100 Subject: [PATCH] redesigned widget for drawing object --- src/gui_qt/_py/guidelinewidget.py | 166 ++++-------------- src/resources/_ui/guidelinewidget.ui | 244 +++++++-------------------- 2 files changed, 92 insertions(+), 318 deletions(-) diff --git a/src/gui_qt/_py/guidelinewidget.py b/src/gui_qt/_py/guidelinewidget.py index 10df080..2ca5059 100644 --- a/src/gui_qt/_py/guidelinewidget.py +++ b/src/gui_qt/_py/guidelinewidget.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/autohome/dominik/nmreval/src/resources/_ui/guidelinewidget.ui' +# Form implementation generated from reading ui file 'src/resources/_ui/guidelinewidget.ui' # -# Created by: PyQt5 UI code generator 5.15.4 +# Created by: PyQt5 UI code generator 5.15.7 # # 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. @@ -14,15 +14,17 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") - Form.resize(459, 830) + Form.resize(316, 678) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) + self.verticalLayout_2.setContentsMargins(3, 3, 3, 3) self.verticalLayout_2.setObjectName("verticalLayout_2") - self.graph_comboBox = QtWidgets.QComboBox(Form) - self.graph_comboBox.setObjectName("graph_comboBox") - self.verticalLayout_2.addWidget(self.graph_comboBox) - self.listWidget_2 = QtWidgets.QListWidget(Form) - self.listWidget_2.setObjectName("listWidget_2") - self.verticalLayout_2.addWidget(self.listWidget_2) + self.treeWidget_2 = QtWidgets.QTreeWidget(Form) + self.treeWidget_2.setRootIsDecorated(True) + self.treeWidget_2.setObjectName("treeWidget_2") + self.treeWidget_2.headerItem().setText(0, "1") + self.treeWidget_2.header().setVisible(False) + self.treeWidget_2.header().setHighlightSections(True) + self.verticalLayout_2.addWidget(self.treeWidget_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton = QtWidgets.QPushButton(Form) @@ -31,132 +33,41 @@ class Ui_Form(object): self.pushButton_2 = QtWidgets.QPushButton(Form) self.pushButton_2.setObjectName("pushButton_2") self.horizontalLayout.addWidget(self.pushButton_2) - self.pushButton_3 = QtWidgets.QPushButton(Form) - self.pushButton_3.setObjectName("pushButton_3") - self.horizontalLayout.addWidget(self.pushButton_3) self.verticalLayout_2.addLayout(self.horizontalLayout) self.frame = QtWidgets.QFrame(Form) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.formLayout = QtWidgets.QFormLayout(self.frame) + self.formLayout.setContentsMargins(-1, -1, -1, 6) self.formLayout.setObjectName("formLayout") + self.label_12 = QtWidgets.QLabel(self.frame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_12.sizePolicy().hasHeightForWidth()) + self.label_12.setSizePolicy(sizePolicy) + self.label_12.setObjectName("label_12") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_12) self.mode_comboBox = QtWidgets.QComboBox(self.frame) self.mode_comboBox.setObjectName("mode_comboBox") self.mode_comboBox.addItem("") self.mode_comboBox.addItem("") self.mode_comboBox.addItem("") self.mode_comboBox.addItem("") + self.mode_comboBox.addItem("") self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.mode_comboBox) - self.label_12 = QtWidgets.QLabel(self.frame) - self.label_12.setObjectName("label_12") - self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_12) - self.label_6 = QtWidgets.QLabel(self.frame) - self.label_6.setObjectName("label_6") - self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_6) - self.comment_lineEdit = QtWidgets.QLineEdit(self.frame) - self.comment_lineEdit.setObjectName("comment_lineEdit") - self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.comment_lineEdit) - self.label_2 = QtWidgets.QLabel(self.frame) - self.label_2.setObjectName("label_2") - self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_2) - self.color_comboBox = ColorListEditor(self.frame) - self.color_comboBox.setObjectName("color_comboBox") - self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.color_comboBox) self.stackedWidget = QtWidgets.QStackedWidget(self.frame) + self.stackedWidget.setFrameShape(QtWidgets.QFrame.NoFrame) self.stackedWidget.setObjectName("stackedWidget") - self.page = QtWidgets.QWidget() - self.page.setObjectName("page") - self.formLayout_2 = QtWidgets.QFormLayout(self.page) - self.formLayout_2.setObjectName("formLayout_2") - self.label_13 = QtWidgets.QLabel(self.page) - self.label_13.setObjectName("label_13") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_13) - self.lineEdit_8 = QtWidgets.QLineEdit(self.page) - self.lineEdit_8.setObjectName("lineEdit_8") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit_8) - self.label = QtWidgets.QLabel(self.page) - self.label.setObjectName("label") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label) - self.infiniteline_angle_spinbox = QtWidgets.QSpinBox(self.page) - self.infiniteline_angle_spinbox.setWrapping(True) - self.infiniteline_angle_spinbox.setMaximum(179) - self.infiniteline_angle_spinbox.setObjectName("infiniteline_angle_spinbox") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.infiniteline_angle_spinbox) - self.stackedWidget.addWidget(self.page) - self.page_2 = QtWidgets.QWidget() - self.page_2.setObjectName("page_2") - self.verticalLayout = QtWidgets.QVBoxLayout(self.page_2) - self.verticalLayout.setObjectName("verticalLayout") - self.listWidget = QtWidgets.QListWidget(self.page_2) - self.listWidget.setObjectName("listWidget") - self.verticalLayout.addWidget(self.listWidget) - self.stackedWidget.addWidget(self.page_2) - self.page_3 = QtWidgets.QWidget() - self.page_3.setObjectName("page_3") - self.formLayout_3 = QtWidgets.QFormLayout(self.page_3) - self.formLayout_3.setObjectName("formLayout_3") - self.label_5 = QtWidgets.QLabel(self.page_3) - self.label_5.setObjectName("label_5") - self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_5) - self.lineEdit = QtWidgets.QLineEdit(self.page_3) - self.lineEdit.setObjectName("lineEdit") - self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit) - self.label_3 = QtWidgets.QLabel(self.page_3) - self.label_3.setObjectName("label_3") - self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3) - self.lineEdit_2 = QtWidgets.QLineEdit(self.page_3) - self.lineEdit_2.setObjectName("lineEdit_2") - self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEdit_2) - self.label_9 = QtWidgets.QLabel(self.page_3) - self.label_9.setObjectName("label_9") - self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_9) - self.lineEdit_3 = QtWidgets.QLineEdit(self.page_3) - self.lineEdit_3.setObjectName("lineEdit_3") - self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEdit_3) - self.label_4 = QtWidgets.QLabel(self.page_3) - self.label_4.setObjectName("label_4") - self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_4) - self.spinBox = QtWidgets.QSpinBox(self.page_3) - self.spinBox.setObjectName("spinBox") - self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.spinBox) - self.stackedWidget.addWidget(self.page_3) - self.page_4 = QtWidgets.QWidget() - self.page_4.setObjectName("page_4") - self.formLayout_4 = QtWidgets.QFormLayout(self.page_4) - self.formLayout_4.setObjectName("formLayout_4") - self.label_7 = QtWidgets.QLabel(self.page_4) - self.label_7.setObjectName("label_7") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_7) - self.lineEdit_4 = QtWidgets.QLineEdit(self.page_4) - self.lineEdit_4.setObjectName("lineEdit_4") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit_4) - self.label_8 = QtWidgets.QLabel(self.page_4) - self.label_8.setObjectName("label_8") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_8) - self.lineEdit_5 = QtWidgets.QLineEdit(self.page_4) - self.lineEdit_5.setObjectName("lineEdit_5") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEdit_5) - self.label_10 = QtWidgets.QLabel(self.page_4) - self.label_10.setObjectName("label_10") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_10) - self.lineEdit_6 = QtWidgets.QLineEdit(self.page_4) - self.lineEdit_6.setObjectName("lineEdit_6") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEdit_6) - self.label_11 = QtWidgets.QLabel(self.page_4) - self.label_11.setObjectName("label_11") - self.formLayout_4.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_11) - self.lineEdit_7 = QtWidgets.QLineEdit(self.page_4) - self.lineEdit_7.setObjectName("lineEdit_7") - self.formLayout_4.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.lineEdit_7) - self.stackedWidget.addWidget(self.page_4) - self.formLayout.setWidget(3, QtWidgets.QFormLayout.SpanningRole, self.stackedWidget) + self.formLayout.setWidget(1, QtWidgets.QFormLayout.SpanningRole, self.stackedWidget) + self.pushButton_3 = QtWidgets.QPushButton(self.frame) + self.pushButton_3.setObjectName("pushButton_3") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.pushButton_3) self.verticalLayout_2.addWidget(self.frame) - self.label_6.setBuddy(self.comment_lineEdit) - self.label_2.setBuddy(self.color_comboBox) self.retranslateUi(Form) - self.stackedWidget.setCurrentIndex(3) + self.stackedWidget.setCurrentIndex(-1) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): @@ -164,23 +75,10 @@ class Ui_Form(object): Form.setWindowTitle(_translate("Form", "Form")) self.pushButton.setText(_translate("Form", "New object")) self.pushButton_2.setText(_translate("Form", "Edit")) - self.pushButton_3.setText(_translate("Form", "Delete")) + self.label_12.setText(_translate("Form", "Type")) self.mode_comboBox.setItemText(0, _translate("Form", "Infinite Line")) self.mode_comboBox.setItemText(1, _translate("Form", "Multiple points")) - self.mode_comboBox.setItemText(2, _translate("Form", "Rectangle")) - self.mode_comboBox.setItemText(3, _translate("Form", "Ellipse")) - self.label_12.setText(_translate("Form", "Type")) - self.label_6.setText(_translate("Form", "Comment")) - self.label_2.setText(_translate("Form", "Color")) - self.label_13.setText(_translate("Form", "Position")) - self.label.setText(_translate("Form", "Angle")) - self.infiniteline_angle_spinbox.setSuffix(_translate("Form", "°")) - self.label_5.setText(_translate("Form", "Lower left")) - self.label_3.setText(_translate("Form", "Width")) - self.label_9.setText(_translate("Form", "Height")) - self.label_4.setText(_translate("Form", "Angle")) - self.label_7.setText(_translate("Form", "Centre")) - self.label_8.setText(_translate("Form", "Axis")) - self.label_10.setText(_translate("Form", "Axis")) - self.label_11.setText(_translate("Form", "Angle")) -from ..lib.delegates import ColorListEditor + self.mode_comboBox.setItemText(2, _translate("Form", "Text")) + self.mode_comboBox.setItemText(3, _translate("Form", "Rectangle")) + self.mode_comboBox.setItemText(4, _translate("Form", "Ellipse")) + self.pushButton_3.setText(_translate("Form", "Create")) diff --git a/src/resources/_ui/guidelinewidget.ui b/src/resources/_ui/guidelinewidget.ui index f302336..5ac0b4d 100644 --- a/src/resources/_ui/guidelinewidget.ui +++ b/src/resources/_ui/guidelinewidget.ui @@ -6,19 +6,43 @@ 0 0 - 459 - 830 + 316 + 678 Form + + 3 + + + 3 + + + 3 + + + 3 + - - - - + + + true + + + false + + + true + + + + 1 + + + @@ -36,13 +60,6 @@ - - - - Delete - - - @@ -54,6 +71,22 @@ QFrame::Raised + + 6 + + + + + + 0 + 0 + + + + Type + + + @@ -66,6 +99,11 @@ Multiple points + + + Text + + Rectangle @@ -78,173 +116,21 @@ - - - - Type + + + + QFrame::NoFrame - - - - - - Comment - - - comment_lineEdit - - - - - - - - - - Color - - - color_comboBox + + -1 - - - - - - 3 + + + Create - - - - - - Position - - - - - - - - - - Angle - - - - - - - true - - - ° - - - 179 - - - - - - - - - - - - - - - - - - Lower left - - - - - - - - - - Width - - - - - - - - - - Height - - - - - - - - - - Angle - - - - - - - - - - - - - - Centre - - - - - - - - - - Axis - - - - - - - - - - Axis - - - - - - - - - - Angle - - - - - - - - @@ -252,16 +138,6 @@ - - - ColorListEditor - QComboBox -
..lib.delegates
-
-
- - -