-
Notifications
You must be signed in to change notification settings - Fork 0
/
newmain.py
88 lines (62 loc) · 2.74 KB
/
newmain.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import sys
import os
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, uic
form_class = uic.loadUiType("newmain.ui")[0]
currentPath = os.getcwd()
class NewMain(QMainWindow, form_class):
def __init__(self):
super().__init__()
self.setupUi(self)
def initUI(self):
#exit of menubar
quit_action = QAction('Exit', self)
quit_action.setShortcut('Crtl+Q')
# enabled the drag and drop facility for our two QListWidgets
self.lineage_list = QListWidget()
self.patient_list = QListWidget()
self.cell_list = QListWidget()
self.drop_list = QListWidget()
self.drop_list.setViewMode(QListWidget.IconMode)
self.lineage_list.setAcceptDrops(True)
self.lineage_list.setDragEnabled(True)
self.patient_list.setAcceptDrops(True)
self.patient_list.setDragEnabled(True)
self.cell_list.setAcceptDrops(True)
self.cell_list.setDragEnabled(True)
self.setGeometry(300, 350, 500, 300)
#add items to two QListWidgets to make sure to have some icons in working directoru
l1 = QListWidgetItem(QIcon('colon.png'), "Colon")
l2 = QListWidgetItem(QIcon('lung.png'), "Lung")
l3 = QListWidgetItem(QIcon('leukemia.png'), "Leukemia")
l4 = QListWidgetItem(QIcon('liver.png'), "Liver")
l5 = QListWidgetItem(QIcon('survival.png'), "Survival")
l6 = QListWidgetItem(QIcon('geneexpression.png'), "Gene(mRNA) expression")
l7 = QListWidgetItem(QIcon('drug.png'), "Drug & Chemicals")
l8 = QListWidgetItem(QIcon('sgRNA.png'), "CRISPR(sgRNA)")
l9 = QListWidgetItem(QIcon('shRNA.png'), "shRHA knockdown")
l10 = QListWidgetItem(QIcon('mRNA.png'), "Gene(mRNA) expression")
self.lineage_list.insertItem(0, l1)
self.lineage_list.insertItem(1, l2)
self.lineage_list.insertItem(2, l3)
self.lineage_list.insertItem(3, l4)
self.patient_list.insertItem(0, l5)
self.patient_list.insertItem(1, l6)
self.cell_list.insertItem(0, l7)
self.cell_list.insertItem(1, l8)
self.cell_list.insertItem(2, l9)
self.cell_list.insertItem(3, l10)
QListWidgetItem(QIcon('colon.png'), "HTLM", self.drop_list)
self.setWindowTitle('Qomics');
self.setLayout(self.myLayout)
self.show()
#statusBar which shows License Number(in this case, 'abcd')
self.statusBar().showMessage('abcd')
self.setGeometry(200, 100, 800, 530)
self.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
myWindow = NewMain()
myWindow.show()
app.exec_()