代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
from PySide6 import QtCore
from PySide6.QtGui import QCursor, Qt
from PySide6.QtWidgets import (QWidget)
from UI.Donation_dark import Ui_Form as UI_dark
from UI.Donation_light import Ui_Form as UI_light
from main import THEME
if THEME == "dark":
UI = UI_dark
else:
UI = UI_light
class Donation(QWidget, UI): # 捐赠窗口类
def __init__(self):
super(Donation, self).__init__()
self.setupUi(self)
# 不显示标题栏
flags = QtCore.Qt.WindowFlags(Qt.FramelessWindowHint)
self.setWindowFlags(flags)
# 不显示空白边框
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
# 设置透明度
self.setWindowOpacity(0.95)
self.label_5.setText('本项目github地址: https://github.com/shiyindebcd/ProcessTrader <a href="https://github.com/shiyindebcd/ProcessTrader"> 点击跳转</a>')
self.label_5.setOpenExternalLinks(True) # 使其成为超链接
self.label_5.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_6.setText('本项目gitee地址: https://gitee.com/shiyindebcd/ProcessTrader <a href="https://gitee.com/shiyindebcd/ProcessTrader"> 点击跳转</a>')
self.label_6.setOpenExternalLinks(True)
self.label_6.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_7.setText('B站软件用法详细解说地址: https://www.bilibili.com <a href="https://www.bilibili.com/video/BV1tY4y177sv?share_source=copy_web&vd_source=0f0ae5e8365c85cd112830a14d80cef6"> 点击跳转</a>')
self.label_7.setOpenExternalLinks(True)
self.label_7.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_8.setText('YouTube软件详细解说地址: https://www.youtube.com <a href="https://www.youtube.com"> 点击跳转</a>')
self.label_8.setOpenExternalLinks(True)
self.label_8.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_9.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_10.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_11.setTextInteractionFlags(Qt.TextBrowserInteraction)
def mousePressEvent(self, e): # 鼠标点击事件
if e.button() == Qt.LeftButton:
self.m_drag = True
self.m_DragPosition = e.globalPosition().toPoint() - self.pos()
e.accept()
self.setCursor(QCursor(Qt.OpenHandCursor))
def mouseReleaseEvent(self, e): # 鼠标释放事件
if e.button() == Qt.LeftButton:
self.m_drag = False
self.setCursor(QCursor(Qt.ArrowCursor))
def mouseMoveEvent(self, e): # 鼠标拖动事件
if Qt.LeftButton and self.m_drag:
self.move(e.globalPosition().toPoint() - self.m_DragPosition)
e.accept()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。