Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Popup a component in qml
Forum Updated to NodeBB v4.3 + New Features

Popup a component in qml

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 165 Views
  • 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.
  • M Offline
    M Offline
    Mandeep.Chaudhary
    wrote on last edited by Mandeep.Chaudhary
    #1

    Hi ,

    I have a component "redSquare" and a rectangle "rect" in main file. rect is visible and on click on the rect the redsquare should pop up.

    I have been spending time on pop up help and not able to find any suitable example that uses given component in it .

    So my question is how to use component in such a manner that given component pops up on a click in rectangle , square shaped any other component.

        Component {
                id: redSquare
    
                Rectangle {
                    color: "red"
                    width: 100
                    height: 100
                }
            }
    
    
    
        Popup {
            id: pp
           
            modal: true
            focus: true
            closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
    
        }
    
            Rectangle {
                        id: rect
                        x: 710
                        y: 10
                        width: 80
                        height: 80
                        radius: 10
                        color: "#ffffff"
                        visible: true
            
                        MouseArea {
                            id: it
                            anchors.fill: parent
                            onClicked: {
                           //     pp.component = redSquare
                                pp.open()
                            }
                        }
                    }
    
    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