Skip to content
Snippets Groups Projects

#31 Legger til manglende properties til SOI

All threads resolved!
Files
2
@@ -138,7 +138,7 @@ class InlineEditableSOIView(QScrollArea):
y : int
"""
# title
label_title = QLabel("SOI TITLE HERE")
label_title = QLabel(self.soi.title)
label_title.move(x, y)
label_title.setStyleSheet("background-color: rgba(0,0,0,0%)")
label_title.setFont(QFont("Times New Roman", 50))
@@ -155,21 +155,22 @@ class InlineEditableSOIView(QScrollArea):
page_number.move(x + (self.soi.CONTENT_WIDTH - label_width) / 2, y)
self.scene.addWidget(page_number)
# grading
grading = QLabel("UGRADERT")
grading.setStyleSheet("background-color: rgba(0,0,0,0%); color: red")
grading.setFont(QFont("Times New Roman", 50))
# classification
classification = QLabel(self.soi.classification)
classification.setStyleSheet("background-color: rgba(0,0,0,0%); "
"color: red")
classification.setFont(QFont("Times New Roman", 50))
# source: https://stackoverflow.com/a/8638114/3545896
# CAUTION: does not work if font is set through stylesheet
label_width = \
grading.fontMetrics().boundingRect(grading.text()).width()
label_width = (classification.fontMetrics()
.boundingRect(classification.text()).width())
x_pos = x + self.soi.CONTENT_WIDTH - label_width - \
self.soi.HEADER_HEIGHT
grading.move(x_pos, y)
self.scene.addWidget(grading)
classification.move(x_pos, y)
self.scene.addWidget(classification)
# patch
pixmap = QPixmap("soitool/media/HVlogo.png")
pixmap = QPixmap(self.soi.icon)
patch = QLabel()
patch.setPixmap(pixmap.scaled(self.soi.HEADER_HEIGHT,
self.soi.HEADER_HEIGHT))
Loading