import QtQuick 2.8
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4
import QtQuick.Controls 2.1
Window
{
id: head
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Loader
{
id: loader
}
Component
{
id: rect
Window
{
id: ppp
visible: true
width: 164
height: 148
title: qsTr("Hello World")
}
}
Rectangle
{
anchors.fill: parent
color: "blue"
Rectangle
{
id: leftArea
height: 100
width: 100
color: "red"
MouseArea
{
anchors.fill: parent
onClicked:
{
loader.sourceComponent = rect
leftArea.parent = loader
}
}
}
}
import QtQuick 2.8
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4
import QtQuick.Controls 2.1
Window
{
id: head
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Loader
{
id: loader
}
Component
{
id: rect
Window
{
id: ppp
visible: true
width: 164
height: 148
title: qsTr("Hello World")
}
}
Rectangle
{
anchors.fill: parent
color: "blue"
Rectangle
{
id: leftArea
height: 100
width: 100
color: "red"
MouseArea
{
anchors.fill: parent
onClicked:
{
loader.sourceComponent = rect
leftArea.parent = loader
}
}
}
}
To copy to clipboard, switch view to plain text mode
When I click on that rectangle, it disapears but it doesn't get shown in the loader's window.
Moreover when I maximize the new resultant window the GUI hangs.
Aim is to make the new Loader's window the parent of the rectangle on click.
Bookmarks