Unsolved Raspberry Pi Transparent QWidget Problem
-
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.3Then , 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. -
Not sure, but maybe need to set alpha buffer size?
QSurfaceFormat format;
format.setAlphaBufferSize(8);
window.setFormat(format);