Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100709

Adding a Button within a popup Window changes it's position

    XMLWordPrintable

Details

    • Windows

    Description

      Hi,

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
          width: 500
          height: 500
          visible: true
      
          Window {
              width: 200
              height: 200
              visible: true
      
              Button {
                  text: "Ok"
                  onClicked: model.submit()
              }
          }
      }
      

      The Window component is intended to open in the center of it's parent  (the ApplicationWindow). It does that when you disable the Button component.

      In the above example code the Window will open somewhere else on your screen. It seems to be the top left corner "mostly" but not always. Definitely not in the center of it's parent window.

      Is there a workaround for this issue? I kinda need the Window to open in the center of it's parent.

      I did play with other window flags to see if that helped but it didn't seem to help at all.

      Cheers,

      Mark

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            markg85 Mark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes