Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Expanding the Window when clicked
Forum Updated to NodeBB v4.3 + New Features

Expanding the Window when clicked

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dev3060
    wrote on last edited by
    #1

    I'm trying to figure out how to get the window to expand when I click on it. If some one can point me in the right direction as far documentation goes it would be greatly appreciated. Thanks

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Check if "this":http://qt-project.org/forums/viewthread/46690/ helps you ?

      157

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dev3060
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          Ok. Also you can change the width and height of the component on doubleclick.

          157

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dev3060
            wrote on last edited by
            #5

            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.1

            Rectangle {
            id:root
            width: 100
            height: 62
            color:"#9c9449"

            MouseArea {
                id: mouseArea1
                doubleClicked:{
                height: 400
                }
            
                anchors.fill: parent
                width: 100
                height: 62
                
            }
            

            }@

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              Well i see multiple issues here,

              1. The handler is onDoubleClicked and not doubleClicked so change it.
              2. 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.
              3. 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.

              157

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved