当前位置:网站首页>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 .
边栏推荐
- Advanced Computer Network Review(5)——COPE
- LeetCode:236. The nearest common ancestor of binary tree
- [daily question] Porter (DFS / DP)
- LeetCode:劍指 Offer 42. 連續子數組的最大和
- KDD 2022论文合集(持续更新中)
- [shell script] use menu commands to build scripts for creating folders in the cluster
- ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
- [OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)
- Nacos installation and service registration
- Different data-driven code executes the same test scenario
猜你喜欢

Selenium+Pytest自动化测试框架实战(下)

BMINF的後訓練量化實現

Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges

LeetCode41——First Missing Positive——hashing in place & swap

Redis之性能指标、监控方式

Opencv+dlib realizes "matching" glasses for Mona Lisa

【shell脚本】——归档文件脚本

Advanced Computer Network Review(3)——BBR

Using C language to complete a simple calculator (function pointer array and callback function)

In depth analysis and encapsulation call of requests
随机推荐
不同的数据驱动代码执行相同的测试场景
Show slave status \ read in G_ Master_ Log_ POS and relay_ Log_ The (size) relationship of POS
力扣每日一题(二)
Redis之核心配置
xargs命令的基本用法
LeetCode:214. Shortest palindrome string
AcWing 2456. Notepad
Once you change the test steps, write all the code. Why not try yaml to realize data-driven?
SimCLR:NLP中的对比学习
LeetCode:124. Maximum path sum in binary tree
Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
Seven layer network architecture
LeetCode:498. 对角线遍历
Li Kou daily question 1 (2)
[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)
七层网络体系结构
Advanced Computer Network Review(3)——BBR
Advanced Computer Network Review(4)——Congestion Control of MPTCP
LeetCode:剑指 Offer 48. 最长不含重复字符的子字符串
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower