-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.py
59 lines (45 loc) · 1.84 KB
/
Application.py
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
from PyQt5 import QtCore,QtWidgets,QtGui
from PyQt5.QtWidgets import *
import os
import random
import csv
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.view = MyView()
self.form_widget = MyTable()
self.setCentralWidget(self.view)
#col_headers = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
#self.form_widget.setHorizontalHeaderLabels(col_headers)
self.setWindowTitle("Plotter")
self.setGeometry(150, 70, 1400, 900)
self.setWindowIcon(QtGui.QIcon("window.jpg"))
self.menu()
def menu(self):
self.bar = self.menuBar()
file = self.bar.addMenu("File")
load_action = QAction('&Load csv file', self)
file.addAction(load_action)
save_action = QAction('&Save file', self)
save_action.setShortcut('Ctrl+S')
file.addAction(save_action)
file.addAction("Save as png")
quit_action = QAction('&Quit', self)
file.addAction(quit_action)
edit = self.bar.addMenu("Edit")
edit.addAction("Edit data")
quit_action.triggered.connect(self.quit_app)
save_action.triggered.connect(self.form_widget.save_sheet)
load_action.triggered.connect(self.form_widget.open_sheet)
self.copyright = QLabel("To plot the graph", self)
self.copyright.setStyleSheet(" color: black; background-color: white; font-size: 15px; ")
self.copyright.setAlignment(QtCore.Qt.AlignCenter)
self.statusBar = QtWidgets.QStatusBar()
self.setStatusBar(self.statusBar)
self.statusBar.addPermanentWidget(self.copyright, 50)
self.show()
def quit_app(self):
qApp.quit()