I am generating a small interface but when I try to add a shadow effect (DropShadowEffect) and a blur () effect, it throws me an error:
This is my code.
import sys
from PyQt5.QtWidgets import QMainWindow, QApplication ,QLabel, QGraphicsEffect, QVBoxLayout, QGraphicsDropShadowEffect, QGraphicsBlurEffect
from PyQt5 import uic
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import QtGui
class Pinricpal(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.resize(97,98)
self.verticalLayout = QVBoxLayout(self)
self.verticalLayout.setObjectName("Verticallayout")
self.label = QLabel(self)
self.label.setText("Nuevo")
self.shadow = QGraphicsDropSahowEffect()
self.shadow.setBlurRadius(5)
self.label.setGraphicsEffect(self.shadow)
self.verticalLayout.addWidget(self.label)
app = QApplication([])
principal = Pinricpal()
principal.show()
app.exec_()
AS AN EXTRA QUESTION: Is it possible to implement this effect in the background of a MainWindow?