У меня есть следующий код, в котором я пытаюсь показать эффект тени за QMainWindow, для которого я использую QGraphicsDropShadowEffect
, чтобы получить тень.
Но при запуске код не приостанавливаетсячто угодно.
Я уже пытался изменить цвет и смещение, но он не работал либо
![enter image description here](https://i.stack.imgur.com/cM75O.png)
Код.Py
from PyQt5.QtWidgets import QMainWindow,QApplication,QGraphicsDropShadowEffect
from PyQt5 import QtCore,QtGui
from PyQt5 import uic
class CInicial(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
uic.loadUi("ConfiguracionInicial.ui",self)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(99)
self.shadow.setColor(QtGui.QColor(99,255,255))
self.shadow.setOffset(4)
self.setGraphicsEffect(self.shadow)
app = QApplication([])
ci = CInicial()
ci.show()
app.exec_()
.Ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>683</width>
<height>482</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="styleSheet">
<string notr="true">background-color:#5E5858;</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QFrame" name="fContenedor1">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>691</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background:qlineargradient(spread:pad, x1:0.498, y1:1, x2:0.472, y2:0, stop:0 rgba(46, 46, 48, 255), stop:1 rgba(137, 137, 137, 255));</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>5</x>
<y>9</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color:white;
background:none;</string>
</property>
<property name="text">
<string>Configuración Inicial</string>
</property>
</widget>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>