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. How to use a transparent window as the desktop background?

How to use a transparent window as the desktop background?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 133 Views
  • 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.
  • S Offline
    S Offline
    senmx
    wrote on last edited by
    #1

    In macOS, if you use objective-c, you can probably achieve it like this:

    - (void)setupWindow {
        NSWindowStyleMask mask = NSWindowStyleMaskBorderless |
                                 NSWindowStyleMaskResizable |
                                 NSWindowStyleMaskFullScreen;
        
        self.window.styleMask = mask;
        self.window.level = kCGDesktopWindowLevel;
        self.view.wantsLayer = YES;
        self.view.layer.backgroundColor = [NSColor clearColor].CGColor;
        self.window.backgroundColor = [NSColor clearColor]; 
    }
    

    And how to do it with QT?
    Get the top-level window QWindow and then convert it to NSWindow, and then use objective-c to implement it?

    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