add image paths
This commit is contained in:
@ -22,6 +22,7 @@ import sys
|
||||
from .switch_button import SwitchButton
|
||||
|
||||
import resources.resources_rc
|
||||
from utils.image_paths import ImagePaths
|
||||
|
||||
|
||||
class VideoStream(QObject):
|
||||
@ -196,14 +197,14 @@ class CameraModule(QWidget):
|
||||
self.title_label.setText(f"{self.camera_name}视频")
|
||||
self.title_label.setObjectName("cameraTitleLabel")
|
||||
self.title_label.setStyleSheet(
|
||||
"""
|
||||
#cameraTitleLabel {
|
||||
f"""
|
||||
#cameraTitleLabel {{
|
||||
font-size: 18px;
|
||||
color: #16ffff;
|
||||
background-image: url(":/icons/images/视频标题背景.png");
|
||||
background-image: url({ImagePaths.VIDEO_TITLE_BACKGROUND});
|
||||
min-width: 180px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
}}
|
||||
"""
|
||||
)
|
||||
|
||||
@ -251,10 +252,10 @@ class CameraModule(QWidget):
|
||||
# "background-color: #011d6b; border: none;"
|
||||
# ) # 明确视频显示背景色
|
||||
self.video_container.setStyleSheet(
|
||||
"""
|
||||
#videoContainer {
|
||||
border-image: url(":/icons/images/视频框背景.png");
|
||||
}
|
||||
f"""
|
||||
#videoContainer {{
|
||||
border-image: url({ImagePaths.VIDEO_FRAME_BACKGROUND});
|
||||
}}
|
||||
"""
|
||||
)
|
||||
video_layout = QVBoxLayout(self.video_container)
|
||||
@ -289,7 +290,7 @@ class CameraModule(QWidget):
|
||||
|
||||
# 加载视频重新连接图片
|
||||
try:
|
||||
pixmap = QPixmap(":/icons/images/界面刷新.png")
|
||||
pixmap = QPixmap(ImagePaths.INTERFACE_REFRESH)
|
||||
if not pixmap.isNull():
|
||||
self.reset_button.setIcon(QIcon(pixmap))
|
||||
self.reset_button.setIconSize(pixmap.size())
|
||||
@ -373,7 +374,7 @@ class VideoTitleWidget(QWidget):
|
||||
|
||||
# 图标标签
|
||||
self.icon_label = QLabel()
|
||||
self.icon_label.setPixmap(QPixmap(":/icons/images/视频摄像头标志.png")) # 需要换为实际的图片的路径
|
||||
self.icon_label.setPixmap(QPixmap(ImagePaths.VIDEO_CAMERA_MARK)) # 需要换为实际的图片的路径
|
||||
self.icon_label.setStyleSheet("background-color: transparent;")
|
||||
self.icon_label.setFixedSize(23, 16)
|
||||
self.icon_label.setScaledContents(True)
|
||||
@ -391,7 +392,7 @@ class VibrationVideoWidget(QWidget):
|
||||
# 1. 加载背景图片(替换为你的图片路径)
|
||||
self.background_image = QImage() # 初始化图片对象
|
||||
# 注意:图片路径需正确,建议使用绝对路径或项目相对路径
|
||||
self.background_path = ":/icons/images/视频背景.png" # 你的背景图片路径
|
||||
self.background_path = ImagePaths.VIDEO_BACKGROUND # 你的背景图片路径
|
||||
if not self.background_image.load(self.background_path):
|
||||
# 图片加载失败时的容错处理(显示红色背景作为提示)
|
||||
print(f"警告:无法加载背景图片 {self.background_path}")
|
||||
|
||||
Reference in New Issue
Block a user