当前位置:网站首页>When QML uses layout layout, a large number of < unknown file >: QML qquicklayoutattached: binding loop detected for property circular binding warnings appear
When QML uses layout layout, a large number of < unknown file >: QML qquicklayoutattached: binding loop detected for property circular binding warnings appear
2022-07-28 03:18:00 【Hard to deal with~】
First QML There are three tools to implement layout :
(1) anchor :anchors
(2) Layout manager :RowLayout、ColumnLayout、GridLayout
(3) positioner :Row、Column、Grid、Flow、Position、Repeater
When implementing the child control to follow the change with the window size , Often use layout manager RowLayout、ColumnLayout、GridLayout, These three layout managers and those three locators Row、Column、Grid There is a difference , When the size of the layout manager changes, the child controls can also follow the change , You can limit the minimum size 、 Maximum size 、 Best size 、 Adaptive width and height , But although the locator can also follow the change through the relationship between the width and height and the parent control , But we cannot limit the minimum 、 Maximum 、 Best size 、 Nor can it adapt to width and height , To achieve the same effect, it is certainly not as convenient as using the layout manager directly .
This article mainly explains the use of layout manager in nesting , Often appear wide 、 High circular binding warning prompt , It takes a long time for the program to enter the screen :

The following error is reported in the above code :

reason :
The above code shows ,ColumnLayout The size of fill for the father's all ,ColumnLayout It's nested RowLayout, And to RowLayout Adaptive width and 32 Height , However, the actual width and height of the layout manager in the layout manager is determined by the width and height of its child controls , So for RowLayout Set the adaptive width and 32 The height of is actually invalid ,RowLayout The actual width and height of is determined by the width and height of its child controls , But its child controls in the code Rectangle The minimum width of is set to the width of the father 30%, This creates an interdependent dead cycle :
RowLayout The width and height of is controlled by its two child controls Rectangle The total width and height of , And two child controls Rectangle The width is determined by the father RowLayout The width of the determines .
resolvent :
(1) The best solution :
When using layout manager nested , A control with settable width and height should be used (Item or Rectangle) As a barrier :

(2) Other solutions : Avoid setting the width and height of its child controls in the directly nested layout manager to be affected by the father , You can set follow grandpa level or above , But often we just need to follow the effect of our father , So this method is not very good .
边栏推荐
- QT专题1:实现一个简易计算器
- 行业洞察 | 语音识别真的超过人耳朵了吗?
- 《MySQL数据库进阶实战》读后感(SQL 小虚竹)
- Es6.--promise, task queue and event cycle
- 满满干货赶紧进来!!!轻松掌握C语言中的函数
- 决策树与随机森林学习笔记(1)
- ECCV 2022 | open source for generative knowledge distillation of classification, detection and segmentation
- C#WinForm开发:如何将图片添加到项目资源文件(Resources)中
- More than 50 interviews have been summarized, and notes and detailed explanations have been taken from April to June (including core test sites and 6 large factories)
- 工程地质实习-工程地质 题集
猜你喜欢
随机推荐
Original title of Blue Bridge Cup
mysql存储过程 使用游标实现两张表数据同步数据
JVM 内存布局详解,图文并茂,写得太好了!
NPDP candidates! The exam requirements for July 31 are here!
stm32F407-------DSP学习
Stm32f407 ------- DSP learning
QT topic 1: implementing a simple calculator
ELS keyboard information
[stream] parallel stream and sequential stream
线程基础
Engineering Geology Practice - engineering geology problem set
汇总了50多场面试,4-6月面经笔记和详解(含核心考点及6家大厂)
基于JSP&Servlet实现的众筹平台系统
Design of the multi live architecture in different places of the king glory mall
Niuke-top101-bm340
Tungsten Fabric SDN — BGP as a Service
The digital twin smart building visualization platform realizes the integration of enterprise and public services in the park
Redis内存回收
嵌入式分享合集22
PCB丝印如何摆?请查收这份手册!









