about qt6 qtquick QML in macos.move rectangle but leave transparent shadow box,otherwise the interface background is completely transparent

30 views Asked by At

First,this picture is my creat UI, enter image description here the next pic is the UI after move rectangleenter image description here obversly,rectangle move but leave a shadow with a frame。 after my test,this phenomenon will occur as long as a rectangle is moved using animation,on a transparent background. this effect is not what i expected。 otherwise,windows have not this phenomenon ,only macos have this phenomenon.

the key code will be presented below.

c++
QGuiApplication app(argc,argv);
QQuickViewer viewer;
viewer.setColor(Qcolor(Qt::transparennt));
viewer.setFlag(Qt::FramelessWindowHint);
viewer.setFlag(Qt::WindowStaysOnTopHint);
viewer.setSource(QUrl("qrc:/QTQA-Creator/Main.qml"));
viewer.show();
qml

Rectangle {
    id: mainRectangle  
    objectName: "mainRectangle"
    width: 850
    height: 600
    color:Qt.rgba(0,0,0,0)

    Rectangle{
        id: mainPageRectangle   
        objectName: "mainPageRectangle"
        width: 770
        height: 600
        radius: 10
        gradient: Gradient {
            GradientStop { position: 0.0; color: Qt.rgba(220/255,42/255,214/255,0.6) }
            //GradientStop { position: 0.5; color: "green" }
            GradientStop { position: 1.0; color: Qt.rgba(80/255,30/255,247/255,0.6) }
        }
        Rectangle{
            id:ttes
            width: 50
            height: 50
            color: "yellow"
        }
    }
    PathAnimation {
        id: parabolaAnimation
        target: mainPageRectangle
        duration: 1000 
        path: Path {
            startX: 0; startY: 0 
            PathQuad {
                x: 20; y: 0 
                controlX: 100; controlY: 300
            }
            PathQuad {
                x: 50; y: 0 
                controlX: 300; controlY: 100
            }
        }
    }
    Component.onCompleted:{
        parabolaAnimation.start();
    

    }
}


this code run in windows without this problem ,the macos have this problem .

if cancel viewer.setColor(Qcolor(Qt::transparennt)); this problem also display.

I make some new attempt。 Place mouse on the soft frame,as the pic hold and move,result pic the soft frame exist,but the shadow and black frame don't exist.

0

There are 0 answers