-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphics_view.py
38 lines (32 loc) · 982 Bytes
/
graphics_view.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
import random
from PySide6.QtGui import QFont, Qt
from PySide6.QtWidgets import QVBoxLayout, QLineEdit
from image_view import ImageView
class GraphicsView(QVBoxLayout):
def __init__(self):
super().__init__()
self.text_view = QLineEdit()
color = random.choice(
[
"#37874c",
"#374687",
"#873783",
"#873746",
"#909639",
"#966939",
"#399681",
"#399658",
"#07677a",
"#650a8c",
"#802d06",
]
)
font = QFont()
font.setBold(True)
font.setPointSize(14)
self.text_view.setFont(font)
self.text_view.setStyleSheet(f"background-color: {color}")
self.text_view.setAlignment(Qt.AlignCenter)
self.image_view = ImageView()
self.addWidget(self.image_view)
self.addWidget(self.text_view)