Qt 6.11 is out! See what's new in the release
blog
Transparent widgets are not moving with their parent
General and Desktop
2
Posts
2
Posters
1.4k
Views
2
Watching
-
I have created a qt application which brings up a transparent widget.
I have one another already running qt application which brings up a form , this qt application will act as a
parent for my transparent widget.
After changing the parent of my transparent widget, now when I move my parent qt window, my transparent widet(now child of second qt application), is not moving at all with repect to its parent.NOTE :- If I remove transparency code then my child widget follows its parent and move along with it.
Please help me where I am going wrong in the below mention code.@
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{ui->setupUi(this); setWindowFlags(Qt::FramelessWindowHint); setStyleSheet("background:transparent;"); setAttribute(Qt::WA_TranslucentBackground); this->setGeometry(200,200,500,500); WId hMSTSCWindow = NULL; //hMSTSCWindow = FindWindow(TEXT("TSSHELLWND"), NULL); hMSTSCWindow = FindWindow(TEXT("QWidget"), TEXT("MainParent")); if(hMSTSCWindow != NULL) { SetParent(this->winId(),hMSTSCWindow ); }@