Problem with WA_TranslucentBackground Attribute.



  • Hello.

    I make some app using Qt.

    I write custom widget and set transparent. But, I can't hide child widget of my custom widget.

    Simply pseudo code in below, someone help me, please.

    class widgetA : public QWidget { ...... }
    class widgetB : public QWidget { ...... }

    main()
    {
        widgetA mainW();
        widgetB childW(&mainW);
    
        // for transparent.
        // without below line, testFunc() is okay.
        // with below line, childW->hide() is not working.
        mainW.setAttribute(Qt::WA_TranslucentBackground);
        .......
    }
    
    wA::testFunc( bool show )
    {
        if( show ) childW->show();
        else childW->hide();
    }
    

    If I set WA_TranslucentBackground, childW->hide() not working.
    When I call childW->hide(), childW still show in my app.

    If I not set WA_TranslucentBackground, childW->show/hide() work fine.

    I using Qt Embedded 4.8 on ARM device, but same result in ubuntu on my desktop.

    Am I made some mistake or something...?

    Thank you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.