So, I just playing with Qt5 to make window translucent. Since the Lazarus's Alpha Blend property makes everything translucent so I using Qt5 functions directly to do that. Here's the code:
procedure TForm1.FormCreate(Sender: TObject);
begin
QWidget_setVisible(TQtMainWindow(Self.Handle).GetContainerWidget, false);
TQtWidget(Panel1.Handle).setParent(TQtMainWindow(Self.Handle).Widget);
QWidget_setAttribute(TQtMainWindow(Self.Handle).Widget, QtWA_TranslucentBackground);
Panel1.Align:=alClient;
end;
But, when I resized the window, something is strange the panel that I've set to use alClient didn't resize when I resized the window. Strangely, when I move the window it resized, the action is kinda late (I guess?). May someone know to make that to behave normally in translucent window?
Anyway, I don't know if the ContainerWidget also can be set as translucent. Now, by doing that is translucent as well.
Here's the change:
procedure TForm1.FormCreate(Sender: TObject);
begin
QWidget_setAttribute(TQtMainWindow(Self.Handle).Widget, QtWA_TranslucentBackground);
QWidget_setAttribute(TQtMainWindow(Self.Handle).GetContainerWidget, QtWA_TranslucentBackground);
end;