redesigned widget for drawing object

This commit is contained in:
Dominik Demuth 2023-02-04 16:27:26 +01:00
parent df8a5e5699
commit 8e2fdcef4c
2 changed files with 92 additions and 318 deletions

View File

@ -1,8 +1,8 @@
# -*- coding: utf-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 # 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. # 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): class Ui_Form(object):
def setupUi(self, Form): def setupUi(self, Form):
Form.setObjectName("Form") Form.setObjectName("Form")
Form.resize(459, 830) Form.resize(316, 678)
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form)
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName("verticalLayout_2")
self.graph_comboBox = QtWidgets.QComboBox(Form) self.treeWidget_2 = QtWidgets.QTreeWidget(Form)
self.graph_comboBox.setObjectName("graph_comboBox") self.treeWidget_2.setRootIsDecorated(True)
self.verticalLayout_2.addWidget(self.graph_comboBox) self.treeWidget_2.setObjectName("treeWidget_2")
self.listWidget_2 = QtWidgets.QListWidget(Form) self.treeWidget_2.headerItem().setText(0, "1")
self.listWidget_2.setObjectName("listWidget_2") self.treeWidget_2.header().setVisible(False)
self.verticalLayout_2.addWidget(self.listWidget_2) self.treeWidget_2.header().setHighlightSections(True)
self.verticalLayout_2.addWidget(self.treeWidget_2)
self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.pushButton = QtWidgets.QPushButton(Form) self.pushButton = QtWidgets.QPushButton(Form)
@ -31,132 +33,41 @@ class Ui_Form(object):
self.pushButton_2 = QtWidgets.QPushButton(Form) self.pushButton_2 = QtWidgets.QPushButton(Form)
self.pushButton_2.setObjectName("pushButton_2") self.pushButton_2.setObjectName("pushButton_2")
self.horizontalLayout.addWidget(self.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.verticalLayout_2.addLayout(self.horizontalLayout)
self.frame = QtWidgets.QFrame(Form) self.frame = QtWidgets.QFrame(Form)
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame") self.frame.setObjectName("frame")
self.formLayout = QtWidgets.QFormLayout(self.frame) self.formLayout = QtWidgets.QFormLayout(self.frame)
self.formLayout.setContentsMargins(-1, -1, -1, 6)
self.formLayout.setObjectName("formLayout") 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 = QtWidgets.QComboBox(self.frame)
self.mode_comboBox.setObjectName("mode_comboBox") 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.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.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 = QtWidgets.QStackedWidget(self.frame)
self.stackedWidget.setFrameShape(QtWidgets.QFrame.NoFrame)
self.stackedWidget.setObjectName("stackedWidget") self.stackedWidget.setObjectName("stackedWidget")
self.page = QtWidgets.QWidget() self.formLayout.setWidget(1, QtWidgets.QFormLayout.SpanningRole, self.stackedWidget)
self.page.setObjectName("page") self.pushButton_3 = QtWidgets.QPushButton(self.frame)
self.formLayout_2 = QtWidgets.QFormLayout(self.page) self.pushButton_3.setObjectName("pushButton_3")
self.formLayout_2.setObjectName("formLayout_2") self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.pushButton_3)
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.verticalLayout_2.addWidget(self.frame) self.verticalLayout_2.addWidget(self.frame)
self.label_6.setBuddy(self.comment_lineEdit)
self.label_2.setBuddy(self.color_comboBox)
self.retranslateUi(Form) self.retranslateUi(Form)
self.stackedWidget.setCurrentIndex(3) self.stackedWidget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form): def retranslateUi(self, Form):
@ -164,23 +75,10 @@ class Ui_Form(object):
Form.setWindowTitle(_translate("Form", "Form")) Form.setWindowTitle(_translate("Form", "Form"))
self.pushButton.setText(_translate("Form", "New object")) self.pushButton.setText(_translate("Form", "New object"))
self.pushButton_2.setText(_translate("Form", "Edit")) 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(0, _translate("Form", "Infinite Line"))
self.mode_comboBox.setItemText(1, _translate("Form", "Multiple points")) self.mode_comboBox.setItemText(1, _translate("Form", "Multiple points"))
self.mode_comboBox.setItemText(2, _translate("Form", "Rectangle")) self.mode_comboBox.setItemText(2, _translate("Form", "Text"))
self.mode_comboBox.setItemText(3, _translate("Form", "Ellipse")) self.mode_comboBox.setItemText(3, _translate("Form", "Rectangle"))
self.label_12.setText(_translate("Form", "Type")) self.mode_comboBox.setItemText(4, _translate("Form", "Ellipse"))
self.label_6.setText(_translate("Form", "Comment")) self.pushButton_3.setText(_translate("Form", "Create"))
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

View File

@ -6,19 +6,43 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>459</width> <width>316</width>
<height>830</height> <height>678</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item> <item>
<widget class="QComboBox" name="graph_comboBox"/> <widget class="QTreeWidget" name="treeWidget_2">
</item> <property name="rootIsDecorated">
<item> <bool>true</bool>
<widget class="QListWidget" name="listWidget_2"/> </property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerHighlightSections">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
@ -36,13 +60,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -54,6 +71,22 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="mode_comboBox"> <widget class="QComboBox" name="mode_comboBox">
<item> <item>
@ -66,6 +99,11 @@
<string>Multiple points</string> <string>Multiple points</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Text</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Rectangle</string> <string>Rectangle</string>
@ -78,190 +116,28 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Comment</string>
</property>
<property name="buddy">
<cstring>comment_lineEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="comment_lineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Color</string>
</property>
<property name="buddy">
<cstring>color_comboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="ColorListEditor" name="color_comboBox"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>-1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Position</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_8"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="infiniteline_angle_spinbox">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="maximum">
<number>179</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="listWidget"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3">
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Lower left</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Height</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_3"/> <widget class="QPushButton" name="pushButton_3">
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Angle</string> <string>Create</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_4">
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Centre</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_4"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Axis</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_5"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Axis</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_6"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_7"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>ColorListEditor</class>
<extends>QComboBox</extends>
<header>..lib.delegates</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui> </ui>