本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsDropShadowEffect方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QGraphicsDropShadowEffect方法的具体用法?Python QtWidgets.QGraphicsDropShadowEffect怎么用?Python QtWidgets.QGraphicsDropShadowEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QGraphicsDropShadowEffect方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(self, path, z_left=1, z_entered=2):
"""
Adds a QGraphicsDropShadowEffect when hovering over the item. Otherwise it is just a clickable
QGraphicsPathItem.
"""
super().__init__(path)
self.z_entered = z_entered
self.z_left = z_left
self.signaller.entered.connect(self.entered_item)
self.signaller.left.connect(self.left_item)
self.hover_effect = QtWidgets.QGraphicsDropShadowEffect()
self.hover_effect.setOffset(4, 4)
self.setGraphicsEffect(self.hover_effect)
# the graphics effect is enabled initially, disable by calling left_item
self.left_item()
示例2: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(self, device_name, is_current_device, certified_on):
super().__init__()
self.setupUi(self)
self.is_current_device = is_current_device
self.label_icon.apply_style()
self.device_name = device_name
self.certified_on = certified_on
self.label_device_name.setText(self.device_name)
if self.is_current_device:
self.label_is_current.setText("({})".format(_("TEXT_DEVICE_IS_CURRENT")))
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.show_context_menu)
effect = QGraphicsDropShadowEffect(self)
effect.setColor(QColor(0x99, 0x99, 0x99))
effect.setBlurRadius(10)
effect.setXOffset(2)
effect.setYOffset(2)
self.setGraphicsEffect(effect)
示例3: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(
self,
user_id,
user_display,
is_current_user,
is_admin,
certified_on,
is_revoked,
current_user_is_admin,
):
super().__init__()
self.setupUi(self)
self.current_user_is_admin = current_user_is_admin
self.is_admin = is_admin
self.is_revoked = is_revoked
self._is_revoked = is_revoked
self.certified_on = certified_on
self.is_current_user = is_current_user
self.user_id = user_id
self.user_display = user_display
self.label_username.setText(user_display)
self.user_icon.apply_style()
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.show_context_menu)
self.label_created_on.setText(format_datetime(self.certified_on, full=True))
self.label_role.setText(
_("TEXT_USER_ROLE_ADMIN") if self.is_admin else _("TEXT_USER_ROLE_CONTRIBUTOR")
)
if self.is_current_user:
self.label_user_is_current.setText("({})".format(_("TEXT_USER_IS_CURRENT")))
effect = QGraphicsDropShadowEffect(self)
effect.setColor(QColor(0x99, 0x99, 0x99))
effect.setBlurRadius(10)
effect.setXOffset(2)
effect.setYOffset(2)
self.setGraphicsEffect(effect)
示例4: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(self, window: QMainWindow, parent=None):
super(MainWindowContainer, self).__init__(parent)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.resize(1024, 580)
layout = QVBoxLayout(self)
layout.addWidget(window)
layout.setContentsMargins(0, 0, 6, 6)
self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(50)
self.shadow.setColor(QtGui.QColor(138, 145, 140))
self.shadow.setOffset(8)
window.setGraphicsEffect(self.shadow)
示例5: enterEvent
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def enterEvent(self, evt: QtCore.QEvent) -> None:
shadow = QGraphicsDropShadowEffect(self)
shadow.setBlurRadius(8)
shadow.setColor(QtGui.QColor(76, 35, 45).lighter())
shadow.setOffset(4)
self.setGraphicsEffect(shadow)
super(SwitchButton, self).enterEvent(evt)
示例6: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(self, window: QDialog, parent=None):
super(VideoViewerContainer, self).__init__(parent)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.resize(1024, 580)
layout = QVBoxLayout(self)
layout.addWidget(window)
layout.setContentsMargins(0, 0, 6, 6)
self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(50)
self.shadow.setColor(QColor(138, 145, 140))
self.shadow.setOffset(8)
window.setGraphicsEffect(self.shadow)
示例7: enterEvent
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def enterEvent(self, evt: QtCore.QEvent) -> None:
# self.setIconSize(QSize(math.floor(self._size.width() * 1.2),math.floor(self._size.height() * 1.2)))
shadow = QGraphicsDropShadowEffect(self)
shadow.setBlurRadius(8)
# shadow.setColor(QtGui.QColor(76,35,45).lighter())
shadow.setColor(QtGui.QColor(76, 35, 45).lighter())
shadow.setOffset(4)
self.setGraphicsEffect(shadow)
super(ImageButton, self).enterEvent(evt)
示例8: addDropShadow
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def addDropShadow(wgt):
"""
Add a white background and a drop shadow for the given widget.
"""
effect = QtWidgets.QGraphicsDropShadowEffect()
effect.setBlurRadius(5)
effect.setXOffset(0)
effect.setYOffset(0)
effect.setColor(QtGui.QColor("#a1a1a1"))
setBackgroundColor(wgt, "white")
wgt.setGraphicsEffect(effect)
示例9: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsDropShadowEffect [as 别名]
def __init__(self, core, jobs_ctx, event_bus, **kwargs):
super().__init__(**kwargs)
self.setupUi(self)
self.jobs_ctx = jobs_ctx
self.core = core
self.event_bus = event_bus
self.menu = MenuWidget(parent=self)
self.widget_menu.layout().addWidget(self.menu)
for e in self.NOTIFICATION_EVENTS:
self.event_bus.connect(e, self.handle_event)
self.menu.organization = self.core.device.organization_addr.organization_id
self.menu.username = self.core.device.user_id
self.menu.device = self.core.device.device_name
self.menu.organization_url = str(self.core.device.organization_addr)
self.new_notification.connect(self.on_new_notification)
self.menu.files_clicked.connect(self.show_mount_widget)
self.menu.users_clicked.connect(self.show_users_widget)
self.menu.devices_clicked.connect(self.show_devices_widget)
self.menu.logout_clicked.connect(self.logout_requested.emit)
self.connection_state_changed.connect(self._on_connection_state_changed)
self.widget_title2.hide()
self.widget_title3.hide()
self.title2_icon.apply_style()
self.title3_icon.apply_style()
effect = QGraphicsDropShadowEffect(self)
effect.setColor(QColor(100, 100, 100))
effect.setBlurRadius(4)
effect.setXOffset(-2)
effect.setYOffset(2)
self.widget_notif.setGraphicsEffect(effect)
self.mount_widget = MountWidget(self.core, self.jobs_ctx, self.event_bus, parent=self)
self.widget_central.layout().insertWidget(0, self.mount_widget)
self.mount_widget.folder_changed.connect(self._on_folder_changed)
self.users_widget = UsersWidget(self.core, self.jobs_ctx, self.event_bus, parent=self)
self.widget_central.layout().insertWidget(0, self.users_widget)
self.devices_widget = DevicesWidget(self.core, self.jobs_ctx, self.event_bus, parent=self)
self.widget_central.layout().insertWidget(0, self.devices_widget)
self._on_connection_state_changed(self.core.backend_status, self.core.backend_status_exc)
self.show_mount_widget()