-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.py
More file actions
28 lines (21 loc) · 823 Bytes
/
Copy pathui.py
File metadata and controls
28 lines (21 loc) · 823 Bytes
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
from PySide6.QtWidgets import (
QWidget,
)
class UserInterface(QWidget):
def __init__(self, width=800, height=600):
super().__init__()
self.resize(width, height)
self.setWindowTitle("Python Program")
# self.image_ui_element = QLabel()
# self.image_ui_element.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
def resizeEvent(self, event):
"""
Override the resizeEvent to rescale UI elements when the window is resized.
"""
# Example: rescaling an image in a QLabel
# pixmap = QPixmap(image_path)
# scaled = pixmap.scaled(
# self.image_ui_element.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation
# )
# self.image_ui_element.setPixmap(scaled)
super().resizeEvent(event)