Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

RowLaoyut reload/refresh after dynamic anchoring



  • Hi all, i have a RowLayout and depending on some variable i have to change its anchoring. (So it is displayed centerd and from right to left)

    Unfortunately it cannot reload when the connection triggers, is there any way to refresh it?

    Code:

    Item
    {
    	id: container
    
    	implicitHeight: layout.implicitHeight
    	implicitWidth: layout.implicitWidth
    
    	RowLayout
    	{
    		id: layout
    		
    		Connections
    		{
    		 	target: container
    		 	onVariableChanged:
    		 	{
    			      if (container.variable.includes("fullScreen"))
    				{	
    		 			layout.anchors.left = undefined
    		 			layout.anchors.right = undefined
    		 			layout.anchors.horizontalCenter = container.horizontalCenter
    		 		}
    		 		else
    		 		{
    		 			layout.anchors.horizontalCenter = undefined
    		 			layout.anchors.left = container.left
    		 			layout.anchors.right = container.right
    		 		}
    		 	}
    		 }
    
    	        SomeItems{...