Qt World Summit: Register Today!

Transparent widgets are not moving with their parent

  • 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) :
    ui(new Ui::MainWindow)

    WId hMSTSCWindow = NULL;
    //hMSTSCWindow = FindWindow(TEXT("TSSHELLWND"), NULL);
    hMSTSCWindow = FindWindow(TEXT("QWidget"), TEXT("MainParent"));
    if(hMSTSCWindow != NULL)
        SetParent(this->winId(),hMSTSCWindow );


  • can anyone help please ?
    i'm having the exact same problem
    except that i wanna move the widgets separately

Log in to reply