Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QGraphicsDropShadowEffect can not show shadow without gnome desktop



  • Hi,
    recently, I found some window use QGraphicsDropShadowEffect to show shadow around the window have different behavior while use lightdm or gdm to start the application.

    Part of my code:

    _layout->setMargin(24);
    QFrame* centralWidget = new QFrame(this);
    _layout->addWidget(centralWidget);
    
    auto* shadow = new QGraphicsDropShadowEffect(this);
    shadow->setOffset(0, 0);
    shadow->setColor(QColor(0x444444));
    shadow->setBlurRadius(30);
    centralWidget->setGraphicsEffect(shadow);
    

    when I start the application after login to gnome desktop, It shows correctly. but when I add my application at /usr/share/xsession directory and then login to the application, the shadow became all black.

    right:
    3.PNG
    incorrect:
    微信图片_20210616094215.jpg

    I am using
    Qt 5.12.10
    Ubuntu 18.04 aarch64
    jetson tx2

    or Does anybody know how to start qt application once the linux system started and no need to show the desktop.

    thank you very much.



  • window decorations are largely under the control of the window manager. Think of the stuff you specify as "hints" not directions.


Log in to reply