当前位置:网站首页>Sizepolicy policy in layout management
Sizepolicy policy in layout management
2022-06-12 17:06:00 【yinchengkai】
One 、sizeHint What is the value ?
When each part is dragged and dropped onto the window , There will be a default sizeHint Size value of ( The top-level window returns sizeHint The value is (-1,-1) ), Same component In the layout manager and Not in manager Of sizeHint It's not the same size , But we found that , Components in the layout pushbutton_1 actual size neither sizeHint The default value of is not set before dragging into the layout size, It's a reference sizeHint The value obtained after ;pushbutton_3 Of size The size is the size we drag in , Not used sizeHint Value
qDebug()<<"pushButton_1:"<<"sizeHint"<<ui->pushButton_1->sizeHint()<<"size:"<<ui->pushButton_1->size();
qDebug()<<"pushButton_2:"<<"sizeHint"<<ui->pushButton_2->sizeHint()<<"size:"<<ui->pushButton_2->size();
qDebug()<<"pushButton_3:"<<"sizeHint"<<ui->pushButton_3->sizeHint()<<"size:"<<ui->pushButton_3->size();The results are as follows , It can be seen that the dimensions in the layout are only for reference sizeHint Value , Not the same as it ; There is no layout pushbutton__3 Size for us to drag in geometry Property :
pushButton_1: sizeHint QSize(97, 28) size: QSize(100, 30)
pushButton_2: sizeHint QSize(97, 28) size: QSize(100, 30)
pushButton_3: sizeHint QSize(105, 28) size: QSize(251, 29)

Two 、sizePolicy Strategies for
1.Fixed

2.Minimum

3.Maximum

There may be a little problem in the summary , You'd better try it yourself
边栏推荐
- Recommend AI intelligent drawing repair software
- Is the securities account opened by qiniu safe? Is it legal?
- Quick start sweep crawler framework
- MySQL事务简介、事务隔离级别
- 2022-2028 global press dehydrator industry research and trend analysis report
- The R language uses the PDF function to save the visual image results to the PDF file, uses the PDF function to open the image device, uses the dev.off function to close the image device, and customiz
- MySQL authorization summary
- Su directly switches to super administrator mode, so that many error reports can be avoided
- Recommend 6 open source projects of yyds
- Difference between big end mode and small end mode
猜你喜欢

Structural requirement analysis of software engineering student information management system

Swin Transformer代码讲解

软件工程 学生信息管理系统 结构化的需求分析

男神女神投票源码 v5.5.21 投票源码

JVM内存模型与本地内存

邱盛昌:OPPO商业化数据体系建设实战

2080 virtual machine login command

Extract the new Chinese cross modal benchmark zero from 5billion pictures and texts, and Qihoo 360's new pre training framework surpasses many SOTAS

写技术博客的意义

Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134)漏洞复现
随机推荐
R language calculates data Table specifies the mean value of a numeric variable when the value of one grouped variable is fixed and another grouped variable
Concurrent trichromatic marking
Three paradigms of database
(四)Golang运算符
写技术博客的意义
Token and idempotency
idea如何设置导包不带*号
R语言使用epiDisplay包的tabpct函数生成二维列联表并使用马赛克图可视化列联表(二维列联表、边际频数、以及按行、按列的比例)、自定义设置ylab参数设置Y轴的轴标签文本(y axis)
Golang recursively encrypts and decrypts all files under the specified folder
MySQL提权总结
RMI, JNDI, LDAP introduction +log4j vulnerability analysis
How to use the official documents of pytorch and torchvision
ShardingJDBC 分库分表详解
记录使用yolov5进行旋转目标的检测
2022-2028 global press dehydrator industry research and trend analysis report
JS using RSA encryption and decryption
Recommend AI intelligent drawing repair software
R language uses the sum function of epidisplay package to calculate the descriptive statistical summary information of the specified variables in dataframe under different grouped variables and visual
丁总路由器设置以及401联网
Unit sshd.service could not be found