import QtQuick 2.4import QtQuick.Controls 1.3import QtQuick.Window 2.2import QtQuick.Dialogs 1.2ApplicationWindow { id: mainWindow title: qsTr("Hello World") width: 640 height: 480 visible: true Rectangle{ color: "black" width: 100 height: 100 anchors.left: parent.left anchors.top: parent.top MouseArea{ anchors.fill: parent onClicked: testWindow.show() } } Window{ id: testWindow flags: Qt.FramelessWindowHint width: 420 height: 131 MouseArea { anchors.fill: parent property variant previousPosition onPressed: { previousPosition = Qt.point(mouseX, mouseY) } onPositionChanged: { if (pressedButtons == Qt.LeftButton) { var dx = mouseX - previousPosition.x var dy = mouseY - previousPosition.y testWindow.x = testWindow.x + dx testWindow.y = testWindow.y + dy } } } }}