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. EnableBlurBehindWindow not working
Forum Updated to NodeBB v4.3 + New Features

EnableBlurBehindWindow not working

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k 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.
  • R Offline
    R Offline
    Rphysx
    wrote on last edited by
    #1

    Title says it all, code so far :
    @
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    QtWin::setCompositionEnabled(true);
    QtWin::enableBlurBehindWindow(&w);
    w.show();
    return a.exec();
    

    }
    @

    Headers and dlls are properly included/linked.
    I tried various approach, enabling it from inside the mainwindow .cpp, enabling it after window show(), tried to force-set composition but so far no luck and here I am stuck again.

    I've been constantly using DWM's functions in plain win32 and one hard to notice problem is that you need to set the window's background brush to black since that's what windows uses as a signal that those pixel should be translucent.

    As a very new Qtdeveloper I'm stuck lost and can't find any other thread online for this specific problem,
    Thanks in advance for any answer

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You need to tell Qt not to fill the widget background because it covers the glass sheet.
      @
      w.setAttribute(Qt::WA_NoSystemBackground);
      @

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rphysx
        wrote on last edited by
        #3

        works wonder, thanks

        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