当前位置:网站首页>QML type: overlay
QML type: overlay
2022-07-06 09:11:00 【Friendly, friend】
One 、 describe
overburden . by Popup Provides a layer , Make sure Popup Show on top of other content , And when modal or dimmed Popup The background darkens when visible .
Overlay is a common layer that covers the entire window Item. It can be used as a visual parent to locate in scene coordinates Popup.
The following example uses additional Overlay.overlay Property will be Popup Locate in the center of the window :
Button {
onClicked: popup.open()
Popup {
id: popup
parent: Overlay.overlay
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
width: 100
height: 100
}
}Two 、 Additional attribute members
1、Overlay.modal : Component
This additional property contains a component , This component is used as an implementation Modality Popup Visual items with darkened background . It is for the visible mode Popup Create and stack below it .
This attribute can be attached to any Popup .
for example , To change the mode Popup The background darkens , You can use the following code :
import QtQuick.Window
import QtQuick.Controls
ApplicationWindow {
id: window
width: 400
height: 400
visible: true
Button {
text: "Open"
onClicked: popup.open()
}
Popup {
id: popup
x: 100
y: 100
width: 200
height: 300
modal: true
focus: true
Overlay.modal: Rectangle {
color: "#800000ff"
}
}
}
2、Overlay.modeless : Component
This additional property contains a component , This component is used as an implementation Modeless Popup The visible item of background dimming . It is for visible dimming Popup Create and stack below it .
This attribute can be attached to any Popup .
for example , To change the background darkening color of the modeless pop-up window , You can use the following code :
Popup {
id: popup
x: 100
y: 100
width: 200
height: 300
focus: true
dim: true // essential
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
Overlay.modeless: Rectangle {
color: "#800000ff"
}
}3、Overlay.overlay : Overlay
This attribute can be attached to any Item、Popup or Window.
3、 ... and 、 Additional signal members
1、pressed()
When the user Popup When you press the stack layer when it is visible , This additional signal will be sent .
2、released()
When the user Popup When the stack layer is released when it is visible , This additional signal will be sent .
边栏推荐
- IJCAI2022论文合集(持续更新中)
- KDD 2022 paper collection (under continuous update)
- Li Kou daily question 1 (2)
- Leetcode刷题题解2.1.1
- LeetCode:394. String decoding
- [three storage methods of graph] just use adjacency matrix to go out
- 【图的三大存储方式】只会用邻接矩阵就out了
- LeetCode:214. Shortest palindrome string
- 力扣每日一题(二)
- Improved deep embedded clustering with local structure preservation (Idec)
猜你喜欢

Mathematical modeling 2004b question (transmission problem)

Intel distiller Toolkit - Quantitative implementation 2

使用latex导出IEEE文献格式

Compétences en mémoire des graphiques UML
![[oc foundation framework] - < copy object copy >](/img/62/c04eb2736c2184d8826271781ac7e3.png)
[oc foundation framework] - < copy object copy >

Detailed explanation of dynamic planning

MySQL uninstallation and installation methods

多元聚类分析

IJCAI2022论文合集(持续更新中)
![[OC]-<UI入门>--常用控件的学习](/img/2c/d317166e90e1efb142b11d4ed9acb7.png)
[OC]-<UI入门>--常用控件的学习
随机推荐
Go redis initialization connection
Notes 01
Improved deep embedded clustering with local structure preservation (Idec)
LeetCode:221. Largest Square
[OC foundation framework] - string and date and time >
Redis之Geospatial
pytorch查看张量占用内存大小
[three storage methods of graph] just use adjacency matrix to go out
什么是MySQL?MySql的学习之路是怎样的
Reids之删除策略
BN folding and its quantification
Advanced Computer Network Review(3)——BBR
Basic usage of xargs command
多元聚类分析
MYSQL卸载方法与安装方法
Redis之Bitmap
LeetCode:836. Rectangle overlap
【shell脚本】使用菜单命令构建在集群内创建文件夹的脚本
一改测试步骤代码就全写 为什么不试试用 Yaml实现数据驱动?
go-redis之初始化连接