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

[REG 6.4->6.5] Binding Loops -> Wrong layout because of interruption

    XMLWordPrintable

Details

    • All
    • e8c8ddeb9 (dev), 6447671ab (6.6), e47da000b (tqtc/lts-6.5), 9ad9d05f2 (dev), a1d551428 (6.7), 1570bd5f8 (6.6), e3022f58f (tqtc/lts-6.5), 7b9f69a69 (dev), 2ad42e1f2 (6.7), a631caf28 (6.6), 5347bff2a (tqtc/lts-6.5), 3fa471978 (dev), 0790b899c (6.7)

    Description

      With Qt 6.4.x all is fine. No binding loops in the log and also the text display is right.

      Starting with Qt 6.5 I get a binding loop when changing text. In the following example there are two loops:

      • implicitWidth when the second button is used first. Also the text uses two lines instead one.
      • implicitHeight every time the first button is used after the second one was used.
      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
      	id: appWindow
      
      	height: 768
      	visible: true
      	width: 432
      
      	ColumnLayout {
      		Button {
      			text: "Long text"
      
      			onClicked: {
      				toast.text = "this is a long text causing a line break to show the binding loop (height) again after the first initialization of the text";
      				toast.open();
      			}
      		}
      		Button {
      			text: "Short text - wrong at first usage - binding loop (width)"
      
      			onClicked: {
      				toast.text = "short text";
      				toast.open();
      			}
      		}
      	}
      	Popup {
      		id: toast
      
      		property alias text: toastText.text
      
      		anchors.centerIn: Overlay.overlay
      		dim: true
      		modal: true
      
      		contentItem: ColumnLayout {
      			Text {
      				id: toastText
      
      				Layout.fillWidth: true
      				wrapMode: Text.Wrap
      			}
      		}
      	}
      }
      

      Attachments

        1. Text.mp4
          12.87 MB
        2. qtbug-117899.zip
          2 kB
        3. ok.png
          ok.png
          40 kB
        4. image-2023-11-01-17-27-44-761.png
          image-2023-11-01-17-27-44-761.png
          47 kB
        5. github.jpg
          github.jpg
          230 kB
        6. example-ok.png
          example-ok.png
          40 kB
        7. example-error.png
          example-error.png
          40 kB
        8. ExampleApp6.zip
          2 kB
        9. ExampleApp4.zip
          2 kB
        10. ExampleApp.zip
          2 kB
        11. error.png
          error.png
          38 kB
        12. current.mp4
          13.51 MB
        13. AusweisApp_Portrait_To_Landscape.mp4
          3.27 MB

        Issue Links

          For Gerrit Dashboard: QTBUG-117899
          # Subject Branch Project Status CR V

          Activity

            People

              santhoshkumar Santhosh Kumar Selvaraj
              larss Lars Schmertmann
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: