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

Blurred background for Main window



  • Using QMainWindow, I want to make the main window (root window) to have blurred transparency as like the screenshot I have attached here.

    I am able to do this blurred background (Screen behind the window is blurred) using the pure native implementation for Mac using NSVisualEffectView available on Mac in Objective-C.

    But i want to implement the same effect using Qt.

    MainWindow.mm

    - (void)awakeFromNib
    {
        [super awakeFromNib];
        [self applyBlurVisualEffect];
    }
    
    - (void)applyBlurVisualEffect
    {
        NSVisualEffectView *view = [[NSVisualEffectView alloc] initWithFrame:self.contentView.bounds];
        view.blendingMode = NSVisualEffectBlendingModeBehindWindow;
        view.material = NSVisualEffectMaterialDark;
        view.state = NSVisualEffectStateActive;
        [self setContentView:view];
    
    }
    

    Is there any Qt Widget attribute or Application Attribute or any other Qt API available for achieving this effect?



  • I am attaching the screenshot here and highlighted the window displayed on the bottom center of the screen.
    Screenshot of Window having blurred background


  • Lifetime Qt Champion

    Hi
    As far as I know, there is nothing like that in Qt. It can blur widgets but not the actual desktop.