×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Dec 2010
    Posts
    63

    How to show a Widget on MouseClick using QML

    Hi every body !
    this is my code

    import QtQuick 1.0

    Rectangle {
    width: 360
    height: 360
    MouseArea {
    x: 85
    y: 9
    width: 156
    height: 50
    anchors.rightMargin: 119
    anchors.bottomMargin: 301
    anchors.leftMargin: 85
    anchors.topMargin: 9
    anchors.fill: parent
    onClicked: {
    flickable1.visible
    }
    }

    Rectangle {
    id: rectangle1
    x: 86
    y: 10
    width: 154
    height: 48
    color: "#dd1414"
    border.color: "#b11414"
    }

    Flickable {
    id: flickable1
    x: 30
    y: 108
    width: 298
    height: 252

    Rectangle {
    id: rectangle2
    x: 94
    y: 49
    width: 100
    height: 100
    color: "#0e9ae0"
    visible: false
    }
    }
    }
    I am trying to show the Flickable element When I click on the mouse Area but it didn't work !!
    Any solution will be appreciated

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: How to show a Widget on MouseClick using QML

    Well, two things:

    1. flickable1.visible = true;

    2. It's the rectangle that is not visible here, the property will only propagate from the parent if it is not explicitly set in the child, toggling the flickable's visibility won't change anything

  3. #3
    Regular Contributor
    Join Date
    Dec 2010
    Posts
    63

    Re: How to show a Widget on MouseClick using QML

    thank u so much !

Similar Threads

  1. How to call/load another QML file from QML ?
    By cadlg in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2011-07-28, 09:15
  2. using Qml, wnat to make sis file on device........
    By amitsharma_ujj in forum [Archived] Beginning Qt
    Replies: 2
    Last Post: 2011-06-11, 21:06
  3. Replies: 1
    Last Post: 2010-10-13, 05:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×