qml-的-Rectangle的窗口显示不出来

Rectangle{
    id: saving;
    width: 470;
    height: 50;
    radius: 5
    anchors.left: parent.left

// x: 0;
// y: -217
z: 5;
visible: false
color: "lightgrey"
MouseArea{
anchors.fill: parent.fill;
}
Text{
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
text: qsTr("saving image ...");
color: "white"
font.pixelSize: 30;
}
}

Rectangle{
    id: photo_save_rect;

    width: 86;
    height: 36
    anchors.bottom: parent.bottom;
    radius: 5;
    color: "transparent"
    BorderImage{
        id: photo_save_rect_image;
        anchors.fill: parent;
        source:  "./res/setting_image/down.png"
    }
    MouseArea{
        anchors.fill: parent;
        onPressed: {
            console.log( "onPressed");
            photo_save_rect_image.source = "./res/setting_image/down_pressed.png";
        }
        onReleased: {
            saving.visible = true;
            for( i = 0; i < 5000; i ++ ){
                for( j = 0; j < 2500; j ++ ){
                }
            }
            saving.visible = false;
            photo_save_rect_image.source = "./res/setting_image/down.png"
        }
    }
}

在main 中 修改为这样 把window 换成rectangle 就可以了

```#include
int main(int argc, char *argv[])
{
QGuiApplication app(argc,argv);

QQuickView viewer;

viewer.setResizeMode(QQuickView::SizeRootObjectToView);
viewer.setSource(QUrl("qrc:///main.qml"));
viewer.show();
return app.exec();

}

现在Rectangle好像不能在运行的时候显示出来东西,可以把他放在一个window的对面里面,导入import QTQuick.Window 2.2
比如图片说明