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. Open child window on same screen as parent
Forum Updated to NodeBB v4.3 + New Features

Open child window on same screen as parent

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 918 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.
  • LorenDBL Offline
    LorenDBL Offline
    LorenDB
    wrote on last edited by LorenDB
    #1

    How do I center a child window on the same screen as the parent window? I've looked at the Screen object, but that doesn't seem to be a good idea.

    Edit: I originally had posted "How do I open a child window...", but realized that it should be changed to "center". Unfortunately, this forum doesn't allow me to edit the thread title. :(

    1 Reply Last reply
    0
    • LorenDBL Offline
      LorenDBL Offline
      LorenDB
      wrote on last edited by
      #2

      Update: I've done some work and gotten a setup where my QML window is given access to an object from C++ which is the current QScreen. This allows me to set screen: to the same screen as the main window (which is, I should mention, a Qt Widgets-derived window containing a QQuickWidget view), but does not meet my main goal of centering the QML window on the screen.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sluci
        wrote on last edited by
        #3

        I don't know if I can help You, bat I used this method:

         inputTime *InputF = new inputTime(this);
                 InputF->show();
                 InputF->setModal(true);
        

        where inputTime is a form "inputTime.ui"

        1 Reply Last reply
        0
        • LorenDBL Offline
          LorenDBL Offline
          LorenDB
          wrote on last edited by
          #4

          Thanks, but that's not QML. Furthermore, I'm not using UI files.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            sluci
            wrote on last edited by
            #5

            In QML I use this method

             onClicked:{
                            var component = Qt.createComponent("DataPathForm.qml")
                            var window    = component.createObject()
                            window.show()
                        }
            

            :-)

            LorenDBL 1 Reply Last reply
            0
            • S sluci

              In QML I use this method

               onClicked:{
                              var component = Qt.createComponent("DataPathForm.qml")
                              var window    = component.createObject()
                              window.show()
                          }
              

              :-)

              LorenDBL Offline
              LorenDBL Offline
              LorenDB
              wrote on last edited by
              #6

              @sluci That's not actually trying to center the window on a parent window. I need to figure out how to center a child window on a parent window. The child window is QML and the parent window is in C++ with a QQuickWidget containing a lot of QML. I'd like this solution to work on multiple monitors.

              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