Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Raspberry Pi Transparent QWidget Problem
Forum Updated to NodeBB v4.3 + New Features

Raspberry Pi Transparent QWidget Problem

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 607 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.
  • Q Offline
    Q Offline
    qtross
    wrote on last edited by qtross
    #1

    Hello to all,
    I am trying to create a transparent widget. I searched it and found a solution which works without problem on linux.

    setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
    setParent(0); // Create TopLevel-Widget
    setAttribute(Qt::WA_NoSystemBackground, true);
    setAttribute(Qt::WA_TranslucentBackground, true);
    

    QTCreator version on linux is 5.11.3.
    However, when i sent the codes and try it on Raspberry pi 4 rasbian buster os, the transparent area stays black when i run the program. Qt Creator version on rasbian is same : 5.11.3

    Then , I tried adding this;

    setAttribute(Qt::WA_PaintOnScreen); 
    

    It works but it makes every object transparent and gives error while running program as;

    Paint device returned engine == 0, type: 1
    

    May the X server on rasbian cause the problem?
    Thank you for any advice.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VaL Doroshchuk
      wrote on last edited by
      #2

      Not sure, but maybe need to set alpha buffer size?
      QSurfaceFormat format;
      format.setAlphaBufferSize(8);
      window.setFormat(format);

      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