Important: Please read the Qt Code of Conduct -

why program is so laggy after using QGraphicsDropShadowEffect

  • Hi here is my code

    QTGui::QTGui(QWidget *parent)
        : QMainWindow(parent),
    	ui(new Ui::MainWindow)
    	connect(ui->btn_close, &QPushButton::clicked, this, &QWidget::close);
    	connect(ui->btn_minimize, &QPushButton::clicked, this, &QWidget::showMinimized);
    	connect(ui->btn_maximize_restore, &QPushButton::clicked, this, &QTGui::maximize_restore);
    	QGraphicsDropShadowEffect* windowShadow = new QGraphicsDropShadowEffect;

    I dont know why, but my program become so laggy after using QGraphicsDropShadowEffect
    can anyone tell me what is my problem?

  • @saeid0034 confirm that behaviour is due to QGraphicsDropShadowEffect by disabling the graphics effect.

    //Using this property, you can disable certain effects on slow platforms, in order to ensure that the user interface is responsive.

    As per Qt docs

    Effects alter the appearance of elements by hooking into the rendering pipeline and operating between the source (e.g., a QGraphicsPixmapItem) and the destination device (e.g., QGraphicsView's viewport).

  • yes, I tested it, when I disabled QGraphicsDropShadowEffect program work normally (its no longer laggy or slow). what can I do to use shadow in my program widget without any performance issues?
    I created a frameless window and I want to use shadow for it

Log in to reply