Expanding the Window when clicked
-
Hi,
Check if "this":http://qt-project.org/forums/viewthread/46690/ helps you ?
-
I appreciate it. What I'm trying to do is have a note expand to a fixed size when I double click the notetoolbar component. Once is does that I can write my notes and scroll up and down. Once I'm done writing the note I just want to double click again and see it go back to its original size.
-
Ok. Also you can change the width and height of the component on doubleclick.
-
I'm still having trouble getting it to work so here is the code for the note component. This is the code for the notetoolbar compnent. If I can get this figured out I'll be good to go. And thanks for your help p3c0
@import QtQuick 2.0
import QtQuick.Layouts 1.1Rectangle {
id:root
width: 100
height: 62
color:"#9c9449"MouseArea { id: mouseArea1 doubleClicked:{ height: 400 } anchors.fill: parent width: 100 height: 62 }
}@
-
Well i see multiple issues here,
- The handler is onDoubleClicked and not doubleClicked so change it.
- Since you want to change the height of Rectangle you must refer to it in MouseArea using the id of Rectangle or since it's a parent of MouseArea you can use parent.
- No need to use binding there.
So,
@
MouseArea {
id: mouseArea1
onDoubleClicked:{
parent.height =400
}
}
@Also you need not specify width and height for MouseArea since you are already filling it to parent's width and height.