Hello,
As the title points out, I’m trying to make a pop up window such that originally the mousearea is a small square rectangle object and when it is clicked upon, the rectangle object will resize to fit a list of ‘settings’.
This is what I have so far:
//HomeScreen.qml
import QtQuick 2.0
Rectangle {
id: settingsButton
height: parent.height*0.05; width: parent.height*0.05
x: parent.height*0.01; y: bar.height*1.2
radius: 10
gradient: Gradient {
GradientStop {position: 0.5; color: "black"}
GradientStop {position: 1.0; color: "gray" }
}
Image {
id: svg
x: bgImage.width*0.0001; y: bgImage.height*0.001
width: bar.height*1.7; height: bar.height*1.7
source: "../../layout/buttons/settings.svg"
}
MouseArea {
anchors.fill: parent
onClicked: {
settingsButton.width = bar.width*0.2
settingsButton.height = bar.width*0.2
}
}
}
I have also created a seperate QML file for the menu list:
//SettingsMenu.qml
import QtQuick 2.0
Column {
anchors.centerIn: parent
spacing: 2
Rectangle {
Text {
text: "Reset";font.pointSize:10; anchors.centerIn: parent;
MouseArea {anchors.fill: parent; onClicked: console.log("Resetting")}
}
}
Rectangle {
Text { text: "Hi";font.pointSize:10; anchors.centerIn: parent }
}
}
The problem I’m having is how to make the MouseArea within my Rectangle in HomeScreen.qml create the QML file SettingsMenu.qml and resize the Rectangle to fit the contents of SettingsMenu.qml
↧