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. qtbug-117899.zip
          2 kB
          Ivan Solovev
        2. ExampleApp.zip
          2 kB
          Lars Schmertmann
        3. ok.png
          40 kB
          Lars Schmertmann
        4. error.png
          38 kB
          Lars Schmertmann
        5. ExampleApp4.zip
          2 kB
          Lars Schmertmann
        6. image-2023-11-01-17-27-44-761.png
          47 kB
          Santhosh Kumar Selvaraj
        7. example-error.png
          40 kB
          Lars Schmertmann
        8. example-ok.png
          40 kB
          Lars Schmertmann
        9. ExampleApp6.zip
          2 kB
          Lars Schmertmann
        10. AusweisApp_Portrait_To_Landscape.mp4
          3.27 MB
          Santhosh Kumar Selvaraj
        11. github.jpg
          230 kB
          Lars Schmertmann
        12. current.mp4
          13.51 MB
          Lars Schmertmann
        13. Text.mp4
          12.87 MB
          Lars Schmertmann

        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
              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: