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

[Material/Fusion Style] MessageDialog binding loop on implicitHeight when too many lines are needed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.5.2, 6.5.6
    • Quick: Dialogs
    • Linux Wayland; Windows 10 22H2 + 1080p screen resolution +100% scaling

    Description

      Code

      import QtQuick.Dialogs
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          width: 400
          height: 300
          visible: true
      
          Button {
              text: "Open dialog"
              onClicked: dlg.open()
          }
      
          MessageDialog {
              id: dlg
              title: "Save Project"
              text: "Save changes?"
              informativeText: "Why is this line missing from the dialog?"
              buttons: MessageDialog.Yes | MessageDialog.No
          }
      }
      

       

      Outcomes
      On the first click, we get binding loop warnings and the informativeText is not shown (Not expected):

      qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/MessageDialog.qml:12:1: QML MessageDialog: Binding loop detected for property "implicitHeight"
      qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/MessageDialog.qml:12:1: QML MessageDialog: Binding loop detected for property "implicitHeight"
      

       

      On the second click, the informativeText does appear (Expected):

       

      Notes

      • Affects Qt 6.5.6, but not Qt 6.7.2
      • Affects Material/Fusion styles, but not Basic/Universal styles
      • The problem does not occur if the window is smaller than the dialog when the button is first clicked

       

      Original Report
      Using this qml, pass a certain number of characters, you get, 

       

      qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/MessageDialog.qml:12:1: QML MessageDialog: Binding loop detected for property "implicitHeight"
      

      main.qml

       

      If you remove the ` more` part, no more errors.

      Attachments

        1. MessageDialog-BindingLoop-NotTriggered.png
          17 kB
          Sze Howe Koh
        2. MessageDialog-BindingLoop-Triggered.png
          14 kB
          Sze Howe Koh
        3. main.qml
          0.5 kB
          Maxime Roussin-Bélanger

        Issue Links

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

          Activity

            People

              santhoshkumar Santhosh Kumar Selvaraj
              roussinm Maxime Roussin-Bélanger
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes