프로젝트

일반

사용자정보

개정판 ad4af9f4

IDad4af9f4354558daa76cf9e5fc2a6cdf8b1aec88
상위 20f78f16
하위 f0ff491d, 52ea09ee

김연진이(가) 약 5년 전에 추가함

issue #1060 : 계산식 오류시 오류창 보여주기

Change-Id: I1a6241f4ec48f70eb5b521147ebbfc40373dfdfd

차이점 보기:

HYTOS/HYTOS/CalculationValidation.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file 'ProjectDialog.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.6
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10
from PyQt5.QtWidgets import *
11
import os
12
from AppDocData import AppDocData
13
import CalculationValidation_UI
14
import math
15

  
16
class QCalculationValidation(QDialog):
17
    def __init__(self):
18
        QDialog.__init__(self)
19
        self.ui = CalculationValidation_UI.Ui_Dialog()
20
        self.ui.setupUi(self)
21

  
22
    def show_dialog(self, cause, detail):
23
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
24

  
25
        self.ui.lineEdit_Cause.setText(cause)
26
        self.ui.listWidget_Detail.insertItem(0, QListWidgetItem(detail))
27

  
28
        return self.exec_()
29

  
30
    def accept(self):
31
        QDialog.accept(self)
32

  
33
    def reject(self):
34
        QDialog.reject(self)
HYTOS/HYTOS/CalculationValidation_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\CalculationValidation.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.13.0
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9

  
10
from PyQt5 import QtCore, QtGui, QtWidgets
11

  
12

  
13
class Ui_Dialog(object):
14
    def setupUi(self, Dialog):
15
        Dialog.setObjectName("Dialog")
16
        Dialog.resize(400, 300)
17
        font = QtGui.QFont()
18
        font.setFamily("맑은 고딕")
19
        Dialog.setFont(font)
20
        icon = QtGui.QIcon()
21
        icon.addPixmap(QtGui.QPixmap(":/images/HYTOS.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
22
        Dialog.setWindowIcon(icon)
23
        self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
24
        self.gridLayout_2.setObjectName("gridLayout_2")
25
        self.gridLayout = QtWidgets.QGridLayout()
26
        self.gridLayout.setObjectName("gridLayout")
27
        self.verticalLayout = QtWidgets.QVBoxLayout()
28
        self.verticalLayout.setObjectName("verticalLayout")
29
        self.horizontalLayout = QtWidgets.QHBoxLayout()
30
        self.horizontalLayout.setObjectName("horizontalLayout")
31
        self.label = QtWidgets.QLabel(Dialog)
32
        self.label.setMinimumSize(QtCore.QSize(50, 0))
33
        self.label.setMaximumSize(QtCore.QSize(50, 16777215))
34
        font = QtGui.QFont()
35
        font.setBold(True)
36
        font.setWeight(75)
37
        self.label.setFont(font)
38
        self.label.setAlignment(QtCore.Qt.AlignCenter)
39
        self.label.setObjectName("label")
40
        self.horizontalLayout.addWidget(self.label)
41
        self.lineEdit_Cause = QtWidgets.QLineEdit(Dialog)
42
        self.lineEdit_Cause.setReadOnly(True)
43
        self.lineEdit_Cause.setObjectName("lineEdit_Cause")
44
        self.horizontalLayout.addWidget(self.lineEdit_Cause)
45
        self.verticalLayout.addLayout(self.horizontalLayout)
46
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
47
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
48
        self.label_2 = QtWidgets.QLabel(Dialog)
49
        self.label_2.setMinimumSize(QtCore.QSize(50, 0))
50
        self.label_2.setMaximumSize(QtCore.QSize(50, 16777215))
51
        font = QtGui.QFont()
52
        font.setBold(True)
53
        font.setWeight(75)
54
        self.label_2.setFont(font)
55
        self.label_2.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
56
        self.label_2.setObjectName("label_2")
57
        self.horizontalLayout_2.addWidget(self.label_2)
58
        self.listWidget_Detail = QtWidgets.QListWidget(Dialog)
59
        self.listWidget_Detail.setObjectName("listWidget_Detail")
60
        self.horizontalLayout_2.addWidget(self.listWidget_Detail)
61
        self.verticalLayout.addLayout(self.horizontalLayout_2)
62
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
63
        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
64
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
65
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
66
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
67
        self.buttonBox.setObjectName("buttonBox")
68
        self.gridLayout_2.addWidget(self.buttonBox, 1, 0, 1, 1)
69

  
70
        self.retranslateUi(Dialog)
71
        self.buttonBox.accepted.connect(Dialog.accept)
72
        self.buttonBox.rejected.connect(Dialog.reject)
73
        QtCore.QMetaObject.connectSlotsByName(Dialog)
74

  
75
    def retranslateUi(self, Dialog):
76
        _translate = QtCore.QCoreApplication.translate
77
        Dialog.setWindowTitle(_translate("Dialog", "Calculation Error"))
78
        self.label.setText(_translate("Dialog", "Cause"))
79
        self.label_2.setText(_translate("Dialog", "Detail"))
80
import Resource_rc
HYTOS/HYTOS/UI/CalculationValidation.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>Dialog</class>
4
 <widget class="QDialog" name="Dialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>400</width>
10
    <height>300</height>
11
   </rect>
12
  </property>
13
  <property name="font">
14
   <font>
15
    <family>맑은 고딕</family>
16
   </font>
17
  </property>
18
  <property name="windowTitle">
19
   <string>Calculation Error</string>
20
  </property>
21
  <property name="windowIcon">
22
   <iconset resource="../res/Resource.qrc">
23
    <normaloff>:/images/HYTOS.png</normaloff>:/images/HYTOS.png</iconset>
24
  </property>
25
  <layout class="QGridLayout" name="gridLayout_2">
26
   <item row="0" column="0">
27
    <layout class="QGridLayout" name="gridLayout">
28
     <item row="0" column="0">
29
      <layout class="QVBoxLayout" name="verticalLayout">
30
       <item>
31
        <layout class="QHBoxLayout" name="horizontalLayout">
32
         <item>
33
          <widget class="QLabel" name="label">
34
           <property name="minimumSize">
35
            <size>
36
             <width>50</width>
37
             <height>0</height>
38
            </size>
39
           </property>
40
           <property name="maximumSize">
41
            <size>
42
             <width>50</width>
43
             <height>16777215</height>
44
            </size>
45
           </property>
46
           <property name="font">
47
            <font>
48
             <weight>75</weight>
49
             <bold>true</bold>
50
            </font>
51
           </property>
52
           <property name="text">
53
            <string>Cause</string>
54
           </property>
55
           <property name="alignment">
56
            <set>Qt::AlignCenter</set>
57
           </property>
58
          </widget>
59
         </item>
60
         <item>
61
          <widget class="QLineEdit" name="lineEdit_Cause">
62
           <property name="readOnly">
63
            <bool>true</bool>
64
           </property>
65
          </widget>
66
         </item>
67
        </layout>
68
       </item>
69
       <item>
70
        <layout class="QHBoxLayout" name="horizontalLayout_2">
71
         <item>
72
          <widget class="QLabel" name="label_2">
73
           <property name="minimumSize">
74
            <size>
75
             <width>50</width>
76
             <height>0</height>
77
            </size>
78
           </property>
79
           <property name="maximumSize">
80
            <size>
81
             <width>50</width>
82
             <height>16777215</height>
83
            </size>
84
           </property>
85
           <property name="font">
86
            <font>
87
             <weight>75</weight>
88
             <bold>true</bold>
89
            </font>
90
           </property>
91
           <property name="text">
92
            <string>Detail</string>
93
           </property>
94
           <property name="alignment">
95
            <set>Qt::AlignHCenter|Qt::AlignTop</set>
96
           </property>
97
          </widget>
98
         </item>
99
         <item>
100
          <widget class="QListWidget" name="listWidget_Detail"/>
101
         </item>
102
        </layout>
103
       </item>
104
      </layout>
105
     </item>
106
    </layout>
107
   </item>
108
   <item row="1" column="0">
109
    <widget class="QDialogButtonBox" name="buttonBox">
110
     <property name="orientation">
111
      <enum>Qt::Horizontal</enum>
112
     </property>
113
     <property name="standardButtons">
114
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
115
     </property>
116
    </widget>
117
   </item>
118
  </layout>
119
 </widget>
120
 <resources>
121
  <include location="../res/Resource.qrc"/>
122
 </resources>
123
 <connections>
124
  <connection>
125
   <sender>buttonBox</sender>
126
   <signal>accepted()</signal>
127
   <receiver>Dialog</receiver>
128
   <slot>accept()</slot>
129
   <hints>
130
    <hint type="sourcelabel">
131
     <x>248</x>
132
     <y>254</y>
133
    </hint>
134
    <hint type="destinationlabel">
135
     <x>157</x>
136
     <y>274</y>
137
    </hint>
138
   </hints>
139
  </connection>
140
  <connection>
141
   <sender>buttonBox</sender>
142
   <signal>rejected()</signal>
143
   <receiver>Dialog</receiver>
144
   <slot>reject()</slot>
145
   <hints>
146
    <hint type="sourcelabel">
147
     <x>316</x>
148
     <y>260</y>
149
    </hint>
150
    <hint type="destinationlabel">
151
     <x>286</x>
152
     <y>274</y>
153
    </hint>
154
   </hints>
155
  </connection>
156
 </connections>
157
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)