2014-08-27 17:10:08 +02:00
/ *
2020-08-13 21:08:54 +02:00
SPDX - FileCopyrightText: 2014 Vishesh Handa < vhanda @ kde . org >
SPDX - License - Identifier: GPL - 2.0 - or - later
* /
2014-08-27 17:10:08 +02:00
import QtQuick 2.0
import QtQuick . Controls 1.1 as Controls
import QtQuick . Layouts 1.1
import org . kde . plasma . core 2.0 as PlasmaCore
ColumnLayout {
Controls . Label {
Layout.maximumWidth: mainLayout . width
wrapMode: Text . WordWrap
2018-10-22 20:05:29 +02:00
text: "Click on each coloured box to make a dialog popup. It should popup in the correct position. The popup should also move from one rectangle to the other on hovering"
2014-08-27 17:10:08 +02:00
}
RowLayout {
id: mainLayout
Rectangle {
width: 300
height: 100
color: "red"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
dialog . visualParent = parent ;
dialog . visible = ! dialog . visible ;
}
onEntered: {
dialog . visualParent = parent ;
}
}
}
Rectangle {
width: 300
height: 100
color: "blue"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
dialog . visualParent = parent ;
dialog . visible = ! dialog . visible ;
}
onEntered: {
dialog . visualParent = parent ;
}
}
}
Rectangle {
width: 300
height: 100
color: "green"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
dialog . visualParent = parent ;
dialog . visible = ! dialog . visible ;
}
onEntered: {
dialog . visualParent = parent ;
}
}
}
Rectangle {
width: 300
height: 100
color: "yellow"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
dialog . visualParent = parent ;
dialog . visible = ! dialog . visible ;
}
onEntered: {
dialog . visualParent = parent ;
}
}
}
PlasmaCore . Dialog {
id: dialog
location: PlasmaCore . Types . BottomEdge
visible: false
Rectangle {
color: "black"
width: 150
height: 150
}
}
}
}