2014-03-04 102 views
0

这是我的QML文件:如何使QML窗口无边界?

Rectangle { 
    width:640; 
    height:360; 

    Text { 
    text:qsTr("Agritrade"); 
    anchors.centerIn:parent; 
    }//text 

    MouseArea { 
    anchors.fill:parent; 
    onClicked: { 
     Qt.quit(); 
    } 
    }//mouse area 
} 

我想使窗口无国界。如何设置上面Rectangle的属性?

+0

你可以像在这个岗位http://stackoverflow.com/questions/2235360/making-a-borderless- window-with-for-qt –

+0

使用Rectangle的QML属性的任何解决方案? – jondinham

回答

0

似乎不可能为Rectangle标签设置属性来制作无边框。

下唯一的解决方案是适用的(利用“setFlags”的方法):

//qml viewer 
QtQuick2ApplicationViewer viewer; 
viewer.setMainQmlFile(QStringLiteral("qml/agritrade/main.qml")); 
viewer.setFlags(Qt::Window|Qt::FramelessWindowHint); 
viewer.showExpanded();