# MedScript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with MedScript. If not, see <https://www.gnu.org/licenses/>.
-import sys
+import sys, os
from PyQt6.QtWidgets import QApplication
from window import MainWindow
if __name__=="__main__":
app=QApplication(sys.argv)
+ with open(os.path.join("resource", "style.qss")) as qss:
+ app.setStyleSheet(qss.read())
window=MainWindow()
sys.exit(app.exec())
# MedScript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with MedScript. If not, see <https://www.gnu.org/licenses/>.
-from PyQt6.QtWidgets import QWidget, QMainWindow, QToolBar, QFileDialog, QComboBox, QSizePolicy
+from PyQt6.QtWidgets import QWidget, QMainWindow, QToolBar, QFileDialog, QComboBox, QPushButton, QSizePolicy
from PyQt6.QtWebEngineWidgets import QWebEngineView
-from PyQt6.QtGui import QAction, QIcon, QPageLayout, QPageSize
+from PyQt6.QtGui import QIcon, QPageLayout, QPageSize
from PyQt6.QtCore import QUrl, QMarginsF
from PyQt6.QtPrintSupport import QPrinter, QPrintDialog
import os
self.printer=QPrinter(QPrinter.PrinterMode.HighResolution)
- action_pdf=QAction("Save PDF", self)
- action_pdf.setShortcut("Ctrl+S")
- action_pdf.triggered.connect(self.cmd_pdf)
- action_print=QAction("Print Document", self)
- action_print.setShortcut("Ctrl+P")
- action_print.triggered.connect(self.cmd_print)
- action_close=QAction("Close Window", self)
- action_close.setShortcut("Ctrl+Q")
- action_close.triggered.connect(self.hide)
+ button_pdf=QPushButton("Save PDF", self)
+ button_pdf.setShortcut("Ctrl+S")
+ button_pdf.clicked.connect(self.cmd_pdf)
+ button_print=QPushButton("Print Document", self)
+ button_print.setShortcut("Ctrl+P")
+ button_print.clicked.connect(self.cmd_print)
+ button_close=QPushButton("Close Window", self)
+ button_close.setShortcut("Ctrl+Q")
+ button_close.clicked.connect(self.hide)
page_size=[]
for size in QPageSize.PageSizeId:
toolbar=QToolBar("View Toolbar", floatable=False, movable=False)
toolbar.addWidget(self.input_size)
- toolbar.addAction(action_pdf)
+ toolbar.addWidget(button_pdf)
spacer=QWidget(self)
spacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
toolbar.addWidget(spacer)
- toolbar.addAction(action_print)
- toolbar.addAction(action_close)
+ toolbar.addWidget(button_print)
+ toolbar.addWidget(button_close)
self.addToolBar(toolbar)
self.webview=QWebEngineView()
--- /dev/null
+QLabel, QLineEdit, QTextEdit, QPushButton, QCheckBox, QComboBox {
+font-size: 14px;
+}
+
+.info_head {
+font-weight: bold;
+}
spacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
toolbar.addWidget(spacer)
self.label_prescriber=QLabel(self)
+ self.label_prescriber=QLabel(self)
toolbar.addWidget(self.label_prescriber)
self.addToolBar(toolbar)
layout_note=QVBoxLayout(tab_note)
layout_note2=QHBoxLayout()
label_note=QLabel("Clinical Notes")
+ label_note.setProperty("class", "info_head")
self.input_note_preset=QComboBox(self)
self.input_note_preset.addItems(self.preset_note.data.keys())
self.input_note_preset.setCurrentIndex(-1)
layout_report=QVBoxLayout(tab_report)
layout_report2=QHBoxLayout()
label_report=QLabel("Available Reports")
+ label_report.setProperty("class", "info_head")
self.input_report_preset=QComboBox(self)
self.input_report_preset.addItems(self.preset_report.data.keys())
self.input_report_preset.setCurrentIndex(-1)
layout_advice=QVBoxLayout(tab_advice)
layout_advice2=QHBoxLayout()
label_advice=QLabel("Advice")
+ label_advice.setProperty("class", "info_head")
self.input_advice_preset=QComboBox(self)
self.input_advice_preset.addItems(self.preset_advice.data.keys())
self.input_advice_preset.setCurrentIndex(-1)
layout_investigation=QVBoxLayout(tab_investigation)
layout_investigation2=QHBoxLayout()
label_investigation=QLabel("Recommended Investigations")
+ label_investigation.setProperty("class", "info_head")
self.input_investigation_preset=QComboBox(self)
self.input_investigation_preset.addItems(self.preset_investigation.data.keys())
self.input_investigation_preset.setCurrentIndex(-1)
layout_medication=QVBoxLayout(tab_medication)
layout_medication2=QHBoxLayout()
label_medication=QLabel("Medication Advice")
+ label_medication.setProperty("class", "info_head")
self.input_medication_preset=QComboBox(self)
self.input_medication_preset.addItems(self.preset_medication.data.keys())
self.input_medication_preset.setCurrentIndex(-1)
layout_additional=QVBoxLayout(tab_additional)
layout_additional2=QHBoxLayout()
label_additional=QLabel("Additional Advice")
+ label_additional.setProperty("class", "info_head")
self.input_additional_preset=QComboBox(self)
self.input_additional_preset.addItems(self.preset_additional.data.keys())
self.input_additional_preset.setCurrentIndex(-1)
layout_attachment=QVBoxLayout(tab_attachment)
layout_attachment2=QHBoxLayout()
label_attachment=QLabel("Attached files")
+ label_attachment.setProperty("class", "info_head")
self.input_attachment=QListWidget(self)
button_add=QPushButton("Add")
button_add.clicked.connect(self.add_attachment)