Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Transparent Background
Forum Updated to NodeBB v4.3 + New Features

Transparent Background

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
1 Posts 1 Posters 253 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.
  • monettesM Offline
    monettesM Offline
    monettes
    wrote on last edited by monettes
    #1

    I created a simple app to show some text with transparent background.

    Window {
        width : 500
        height : 410
        visible: true
        color: "#00000000"
        flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground
    
        Rectangle {
            x: 0
            y: 0
            width: 500
            height: 410
            radius: 20
            color: "#00000000"
    
            Text {
                text: "Testing waters"
                color: "#FF0000"
                font.bold: true
                font.pointSize: 30
            }
        }
    }
    
    

    It works perfectly when I build the app in MacOS Desktop.
    Screenshot 2023-02-19 at 12.06.07 PM.png
    But when I build for Web Assembly, the background is always solid white. I tried modifying the qtloader.js to set the transparent background but it's always white. I load the wasm in my OBS browser and it needs to have a transparent background, but it's always white. I can create HTML & JS files in OBS and it works perfectly, but not with my wasm code. This is not a OBS issue.
    Screenshot 2023-02-19 at 12.07.10 PM.png
    When it's loading the wasm file, the background is transparent until it's running my code.

    How can I run my wasm app with a transparent background?

    Here's a sample using HTML and JS code I wrote to run with a transparent background. You can see my web app running at the bottom of the screen. So OBS is not setting any background color when running a web script.

    Screenshot 2023-02-19 at 12.13.22 PM.png

    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