当前位置: 首页>>代码示例>>Python>>正文


Python QtWidgets.QGraphicsDropShadowEffect方法代码示例

本文整理汇总了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() 
开发者ID:Trilarion,项目名称:imperialism-remake,代码行数:21,代码来源:graphics.py

示例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) 
开发者ID:Scille,项目名称:parsec-cloud,代码行数:20,代码来源:devices_widget.py

示例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) 
开发者ID:Scille,项目名称:parsec-cloud,代码行数:38,代码来源:users_widget.py

示例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) 
开发者ID:haruiz,项目名称:CvStudio,代码行数:15,代码来源:main_window.py

示例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) 
开发者ID:haruiz,项目名称:CvStudio,代码行数:9,代码来源:switch_button.py

示例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) 
开发者ID:haruiz,项目名称:CvStudio,代码行数:15,代码来源:video_dialog.py

示例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) 
开发者ID:haruiz,项目名称:CvStudio,代码行数:11,代码来源:image_button.py

示例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) 
开发者ID:decred,项目名称:tinydecred,代码行数:13,代码来源:qutilities.py

示例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() 
开发者ID:Scille,项目名称:parsec-cloud,代码行数:52,代码来源:central_widget.py


注:本文中的PyQt5.QtWidgets.QGraphicsDropShadowEffect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。