Skip to content
Snippets Groups Projects

About window

Merged Petter Källström requested to merge about_window into master
1 file
+ 64
21
Compare changes
  • Side-by-side
  • Inline
+ 64
21
import sys # ONLY FOR DEBUG
from qtpy.QtCore import Qt
from qtpy.QtGui import QPixmap
from qtpy.QtWidgets import QApplication # ONLY FOR DEBUG
from qtpy.QtWidgets import (
QDialog,
QFrame,
QHBoxLayout,
QLabel,
QPushButton,
QScrollArea,
QVBoxLayout,
)
@@ -120,34 +125,58 @@ class AboutWindow(QDialog):
self.add_information_to_layout()
def add_information_to_layout(self):
information_layout = QVBoxLayout()
title_label = QLabel("B-ASIC / Better ASIC Toolbox")
subtitle_label = QLabel(
"Construct, simulate and analyze components of an ASIC."
# |1 Title |2 |
# | License | Logo | <- layout12
# | Version | |
# ----------------------
# |3 links |4 OK | <- layout34
version_str = "Magic"
label1 = QLabel(
"# B-ASIC / Better ASIC Toolbox\n*Construct, simulate and analyze"
" components of an ASIC.*\n\nB-ASIC is an open source tool using"
" the B-ASIC library to construct, simulate and analyze"
" ASICs.\n\nB-ASIC is developed under the MIT-license and any"
" extension to the program should follow that same license.\n\nTo"
" read more about how the GUI works please refer to the FAQ under"
f" 'Help'.\n\n*Version: {version_str}*"
)
label1.setTextFormat(Qt.MarkdownText)
label1.setWordWrap(True)
frame = QFrame()
frame.setFrameShape(QFrame.HLine)
frame.setFrameShadow(QFrame.Sunken)
self.dialog_layout.addWidget(frame)
self.logo2 = QLabel(self)
self.logo2.setPixmap(
QPixmap("../../small_logo.png").scaledToWidth(100)
)
self.logo2.setFixedWidth(100)
about_label = QLabel(
"B-ASIC is an open source tool using the B-ASIC library to "
"construct, simulate and analyze ASICs.\n"
"B-ASIC is developed under the MIT-license and any extension to "
"the program should follow that same license.\n"
"To read more about how the GUI works please refer to the FAQ "
"under 'Help'."
label3 = QLabel(
"""See our <a href="https://gitlab.liu.se/da/B-ASIC/">git page</a>"""
)
label3.setOpenExternalLinks(True)
information_layout.addWidget(title_label)
information_layout.addWidget(subtitle_label)
button4 = QPushButton()
button4.setText("OK")
button4.setFixedWidth(80)
button4.clicked.connect(self.close)
self.dialog_layout.addLayout(information_layout)
self.dialog_layout.addWidget(frame)
layout12 = QHBoxLayout()
layout34 = QHBoxLayout()
layout12.addWidget(label1)
layout12.addWidget(self.logo2)
self.dialog_layout.addWidget(about_label)
layout34.addWidget(label3)
layout34.addWidget(button4)
hline = QFrame()
hline.setFrameShape(QFrame.HLine)
hline.setFrameShadow(QFrame.Sunken)
self.dialog_layout.addLayout(layout12)
self.dialog_layout.addWidget(hline)
self.dialog_layout.addLayout(layout34)
class FaqWindow(QDialog):
@@ -183,3 +212,17 @@ class FaqWindow(QDialog):
question_layout.addLayout(answer_layout)
self.dialog_layout.addLayout(question_layout)
# ONLY FOR DEBUG below
def start_about_window():
app = QApplication(sys.argv)
window = AboutWindow(QDialog)
window.show()
sys.exit(app.exec_())
if __name__ == "__main__":
start_about_window()
Loading