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. How to load Popup component from other .qml
Forum Updated to NodeBB v4.3 + New Features

How to load Popup component from other .qml

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 1.2k 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.
  • J Offline
    J Offline
    JANG SOONMYUN
    wrote on last edited by
    #1

    I'm trying to make popup function on QML, but it didn't work.

    Firstly, I made main.qml and put a button to open a popup window. If I put the Popup component in the same .qml file, it worked well. But I want to separate components to modify easily.

    [main.qml]

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.12
    
    Window {
        width: 1024
        height: 720
        visible: true
        title: qsTr("Hello World")
    
        Button {
            id: btn_Crop_Template
            x: 31
            y: 237
            width: 170
            height: 50
            text: qsTr("Crop Template")
            onClicked: popup.open()
        }
    }
    
    

    [imgproc_popup.qml]

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.12
    
    Popup {
            id: popup
            x: 100
            y: 100
            width: 1000
            height: 500
            modal: true
            focus: true
    
            closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
        }
    
    

    How can I load the popup window?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JANG SOONMYUN
      wrote on last edited by
      #2

      Solution
      https://stackoverflow.com/questions/45469881/access-items-in-different-qml-files

      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