-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegressionGUI.py
More file actions
67 lines (53 loc) · 2.07 KB
/
Copy pathRegressionGUI.py
File metadata and controls
67 lines (53 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import (QWidget, QPushButton, QLabel, QHBoxLayout, QSlider, QMenuBar)
from PyQt5.QtGui import QFont
import sys
import PyQt5
from Regression import Regression
if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'):
PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
class RegressionGUI(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(300, 100, 700, 500)
self.setWindowTitle('Regression')
self.regression = Regression()
self.regression.setGeometry(500, 100, 500, 500)
self.regression.setFixedSize(500, 500)
horizontal_box = QHBoxLayout()
horizontal_box.setAlignment(QtCore.Qt.AlignLeft)
horizontal_box.setAlignment(QtCore.Qt.AlignBottom)
horizontal_box.stretch(1)
horizontal_box.addWidget(self.regression)
self.setLayout(horizontal_box)
header = QFont("Calibre")
header.setPointSize(14)
header.setBold(True)
regression_label = QLabel('Regressions', self)
regression_label.move(553, 10)
regression_label.setFont(header)
regression_label.resize(140, 50)
linear_button = QPushButton('Linear', self)
linear_button.move(560, 70)
linear_button.resize(100, 50)
linear_button.clicked.connect((lambda: self.regression.change_mode('linear')))
exponential_button = QPushButton('Exponential', self)
exponential_button.move(560, 130)
exponential_button.resize(100, 50)
exponential_button.clicked.connect((lambda: self.regression.change_mode('exponential')))
clear_font = QFont('Calibre')
clear_font.setPointSize(10)
clear_font.setBold(True)
clear_button = QPushButton('Clear', self)
clear_button.move(560, 400)
clear_button.resize(100, 50)
clear_button.setFont(clear_font)
clear_button.clicked.connect(lambda: self.regression.clear_points())
if __name__ == '__main__':
app = QApplication(sys.argv)
regression_GUI = RegressionGUI()
regression_GUI.show()
sys.exit(app.exec_())