Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Draggable Popup
Qt 6.12 LTS is out! See what's new in the release blog

Draggable Popup

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 4 Posters 3.1k 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.
  • A Offline
    A Offline
    adaptine
    wrote on last edited by adaptine
    #1

    Hi, how can I achieve a dragable popup, which the user can move around the screen?
    I have a QML component with a MouseArea child using onClicked: myPopup.open()

    myPopup.qml:

    Popup {
        id: root
        x: 100
        closePolicy: Popup.CloseOnEscape 
    
        contentItem: GroupBox {
             // * Snip *
        }
    

    Qt Quick 5.12.10

    ODБOïO 1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      Popup are limited to stay inside their parent window for now.

      If you want something that can be moved outside, use a Window and not a Popup.

      1 Reply Last reply
      0
      • A adaptine

        Hi, how can I achieve a dragable popup, which the user can move around the screen?
        I have a QML component with a MouseArea child using onClicked: myPopup.open()

        myPopup.qml:

        Popup {
            id: root
            x: 100
            closePolicy: Popup.CloseOnEscape 
        
            contentItem: GroupBox {
                 // * Snip *
            }
        

        Qt Quick 5.12.10

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by
        #3

        @adaptine hi
        You can define your contentItem like this to move it in your window

         contentItem: Rectangle{
                
                    Drag.active: true
                    MouseArea{
                        anchors.fill: parent
                        drag.target: parent
                    }
         // the content 
        }
        

        You could also use a QML Window instead

        1 Reply Last reply
        1

        • Login

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