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

Centering popups and dialogs

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 5.12.0 Alpha
    • None
    • Quick: Controls 2
    • None
    • 1abc7fcbabcc5a89ceaaf69173d077e22ed2d658

    Description

      Centering popups and dialogs is very common, so we should make it more straight-forward. Dialogs could possibly even center to the window by default, unless explicitly positioned otherwise.

      Some ideas we've had so far:

      a) using magic enum values like Popup.CenterInParent (and Popup.CenterInWindow):

      ApplicationWindow {
          Button {
              Popup {
                  x: Popup.CenterInParent // or Popup.CenterInWindow, or parent: window.overlay
                  y: Popup.CenterInParent // or Popup.CenterInWindow, or parent: window.overlay
              }
          }
      }
      

      b) a dedicated property, similar to anchors.centerIn:

      ApplicationWindow {
          id: window
          Button {
              Popup {
                  centerIn: parent // or centerIn: window
              }
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              mitch_curtis Mitch Curtis
              jpnurmi J-P Nurmi
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: