Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't add shadow to frameless window

Can't add shadow to frameless window

Scheduled Pinned Locked Moved General and Desktop
shadowwindowframeless
1 Posts 1 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dymytr Yovchev
    wrote on last edited by Dymytr Yovchev
    #1

    How to add a full shadow to MainWindow or centralwidget?

    I already use this
    Not work for me =
    and also try different flags:

    setAttribute(Qt::WA_TranslucentBackground); //enable MainWindow to be transparent
    setMask(geometry());
            this->setWindowFlags(Qt::SplashScreen); //enable MainWindow to be transparent
            this->setWindowFlags( Qt::FramelessWindowHint); //enable MainWindow to be transparent
    

    and also show()
    and apply shadow effect

        CustomShadowEffect* shadowEffect = new CustomShadowEffect();
        shadowEffect->setBlurRadius(9.0);
        shadowEffect->setDistance(6.0);
        shadowEffect->setColor(QColor(0, 0, 0, 80));
        this->centralWidget->setAutoFillBackground(true);
        this->centralWidget->setGraphicsEffect(shadowEffect);
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved