-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqcs.py
More file actions
145 lines (127 loc) · 4.56 KB
/
Copy pathqcs.py
File metadata and controls
145 lines (127 loc) · 4.56 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/env python3
"""Quantum Circuit Simulator — Python reimplementation of QCS by Dr. I. Karafyllidis."""
import sys
import matplotlib
matplotlib.use('QtAgg') # Must be before any other matplotlib imports
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
from gui.main_window import MainWindow
APP_STYLESHEET = """
/* ── Base ─────────────────────────────────────────────────────── */
QMainWindow, QWidget {
background-color: #f0f2f5;
font-family: "Helvetica Neue", Arial;
font-size: 9pt;
color: #1e293b;
}
/* ── Group boxes ──────────────────────────────────────────────── */
QGroupBox {
border: 1px solid #e2e8f0;
border-radius: 8px;
margin-top: 10px;
padding: 6px 4px 4px 4px;
background-color: white;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 0 8px;
color: #64748b;
font-weight: bold;
font-size: 8pt;
}
/* ── Combo boxes ──────────────────────────────────────────────── */
QComboBox {
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 3px 8px;
background-color: white;
min-height: 26px;
color: #1e293b;
}
QComboBox:hover { border-color: #818cf8; }
QComboBox:focus { border-color: #6366f1; }
QComboBox::drop-down {
border: none;
width: 16px;
}
/* ── Scroll bars ──────────────────────────────────────────────── */
QScrollBar:vertical {
width: 8px;
background: transparent;
margin: 0;
}
QScrollBar::handle:vertical {
background: #cbd5e1;
border-radius: 4px;
min-height: 24px;
}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; }
QScrollBar:horizontal {
height: 8px;
background: transparent;
}
QScrollBar::handle:horizontal {
background: #cbd5e1;
border-radius: 4px;
min-width: 24px;
}
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { width: 0; }
/* ── Status bar ───────────────────────────────────────────────── */
QStatusBar {
background: #1e293b;
color: #94a3b8;
font-size: 8pt;
padding: 2px 8px;
}
QStatusBar::item { border: none; }
/* ── Tooltips ─────────────────────────────────────────────────── */
QToolTip {
background: #1e293b;
color: #f8fafc;
border: none;
border-radius: 4px;
padding: 4px 8px;
font-size: 8pt;
}
/* ── Message boxes ────────────────────────────────────────────── */
QMessageBox { background-color: white; }
/* ── Dialog ───────────────────────────────────────────────────── */
QDialog { background-color: #f8fafc; }
QListWidget {
border: 1px solid #e2e8f0;
border-radius: 6px;
background-color: white;
outline: none;
}
QListWidget::item { padding: 6px 8px; border-radius: 4px; }
QListWidget::item:selected {
background-color: #ede9fe;
color: #4f46e5;
}
QListWidget::item:hover { background-color: #f1f5f9; }
QDoubleSpinBox {
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 3px 6px;
background: white;
min-height: 26px;
}
QDoubleSpinBox:hover { border-color: #818cf8; }
/* ── Splitter ─────────────────────────────────────────────────── */
QSplitter::handle { background: #e2e8f0; }
QSplitter::handle:vertical { height: 3px; }
QSplitter::handle:horizontal { width: 3px; }
"""
def main():
app = QApplication(sys.argv)
app.setApplicationName("Quantum Circuit Simulator")
app.setOrganizationName("QCS-Python")
app.setStyleSheet(APP_STYLESHEET)
app.setStyleSheet(app.styleSheet()) # force stylesheet reapply
QApplication.setEffectEnabled(Qt.UIEffect.UI_AnimateTooltip, False) # instant tooltip show
window = MainWindow()
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()