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. Make Independent Popup
Qt 6.11 is out! See what's new in the release blog

Make Independent Popup

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 562 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.
  • PadawanP Offline
    PadawanP Offline
    Padawan
    wrote on last edited by
    #1

    I have an app which is small in terms of width and height, I want a popup to show when a button is clicked. Problem is the popup is larger than the app window and when i open it, it scales down and looks weird

    APP
    f572d9c0-7ff4-4797-b5de-84c68b456dc4-image.png

    APP WITH POPUP
    7824844e-c884-484a-9f33-e14fb00c2d73-image.png

    POPUP CONTENT IN DESIGNER
    24317906-ffa6-4132-bf03-aac773542d7f-image.png

    How can i make the popup independent from the app window, like this:
    33c43137-9827-4f18-9afc-8c49c3c323c6-image.png

    Or is there a better approach rather than using popup, it would be nice if i were able to move the popup/window around.

    Ningen

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #3

      Use a Window instead of a Popup.

      PadawanP 1 Reply Last reply
      2
      • PadawanP Offline
        PadawanP Offline
        Padawan
        wrote on last edited by
        #2

        It has to still be a child of the app itself because it needs some data from it

        Ningen

        1 Reply Last reply
        0
        • GrecKoG Offline
          GrecKoG Offline
          GrecKo
          Qt Champions 2018
          wrote on last edited by
          #3

          Use a Window instead of a Popup.

          PadawanP 1 Reply Last reply
          2
          • GrecKoG GrecKo

            Use a Window instead of a Popup.

            PadawanP Offline
            PadawanP Offline
            Padawan
            wrote on last edited by
            #4

            @GrecKo Thanks

            I've gotten it sorted out. I encapsulated the component i wanted to show inside a window and created it using Qt.createComponent()

            var playListComponent = Qt.createComponent("CustomPlaylist.qml")
            var window = playListComponent.createObject(rootWindow)
            window.show()
            

            The root element of CustomPlaylist.qml is a Window
            8b13d557-b014-413f-bbfc-efda46c9a1d6-image.png

            Ningen

            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