hytos / HYTOS / HYTOS / FittingMethodDialog.py @ 5ddf3ffe
이력 | 보기 | 이력해설 | 다운로드 (1.71 KB)
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 |
import os |
9 |
import sys |
10 |
from PyQt5 import QtCore, QtGui, QtWidgets |
11 |
from PyQt5.QtWidgets import * |
12 |
from AppDocData import AppDocData |
13 |
import FittingMethod_UI |
14 |
import math |
15 |
|
16 |
class QFittingMethodDialog(QDialog): |
17 |
def __init__(self): |
18 |
QDialog.__init__(self)
|
19 |
|
20 |
self.ui = FittingMethod_UI.Ui_FittingMethodDialog()
|
21 |
self.ui.setupUi(self) |
22 |
self.selectedFittingMethod = None |
23 |
self.initFittingMethod()
|
24 |
|
25 |
def initFittingMethod(self): |
26 |
self.ui.comboBox_FittingMethod.clear()
|
27 |
|
28 |
self.ui.comboBox_FittingMethod.addItem('Equivalent Length Method', 'EquivalentLength') |
29 |
self.ui.comboBox_FittingMethod.addItem('Crane K Method', 'CraneK') |
30 |
self.ui.comboBox_FittingMethod.addItem('2-K Method', '2K') |
31 |
|
32 |
self.ui.comboBox_FittingMethod.setCurrentIndex(0) |
33 |
|
34 |
def showDialog(self, item): |
35 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
36 |
self.exec_()
|
37 |
|
38 |
return self.selectedFittingMethod |
39 |
|
40 |
def accept(self): |
41 |
index = self.ui.comboBox_FittingMethod.currentIndex()
|
42 |
FittingMethod = self.ui.comboBox_FittingMethod.itemData(index)
|
43 |
self.selectedFittingMethod = FittingMethod
|
44 |
QDialog.accept(self)
|
45 |
|
46 |
def reject(self): |
47 |
QDialog.reject(self)
|
48 |
|
49 |
|
50 |
if __name__ == '__main__': |
51 |
from FittingMethodDialog import QFittingMethodDialog |
52 |
from App import App |
53 |
app = App(sys.argv) |
54 |
|
55 |
|
56 |
if True: |
57 |
dlg = QFittingMethodDialog() |
58 |
dlg.exec_() |