当前位置:网站首页>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 .
边栏推荐
- Advance Computer Network Review(1)——FatTree
- SAP ui5 date type sap ui. model. type. Analysis of the parsing format of date
- 七层网络体系结构
- CSP student queue
- KDD 2022论文合集(持续更新中)
- LeetCode:41. Missing first positive number
- Detailed explanation of dynamic planning
- [OC foundation framework] - string and date and time >
- 在QWidget上实现窗口阻塞
- [Hacker News Weekly] data visualization artifact; Top 10 Web hacker technologies; Postman supports grpc
猜你喜欢
Advanced Computer Network Review(4)——Congestion Control of MPTCP
[OC-Foundation框架]-<字符串And日期与时间>
[sword finger offer] serialized binary tree
MongoDB 的安装和基本操作
[OC foundation framework] - string and date and time >
Selenium+pytest automated test framework practice (Part 2)
多元聚类分析
A convolution substitution of attention mechanism
Advanced Computer Network Review(5)——COPE
[oc]- < getting started with UI> -- common controls - prompt dialog box and wait for the prompt (circle)
随机推荐
CSP student queue
[Hacker News Weekly] data visualization artifact; Top 10 Web hacker technologies; Postman supports grpc
LeetCode41——First Missing Positive——hashing in place & swap
LeetCode:221. Largest Square
[oc]- < getting started with UI> -- learning common controls
Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
LeetCode41——First Missing Positive——hashing in place & swap
Mongodb installation and basic operation
Once you change the test steps, write all the code. Why not try yaml to realize data-driven?
BMINF的后训练量化实现
Pytorch view tensor memory size
[OC]-<UI入门>--常用控件的学习
【shell脚本】使用菜单命令构建在集群内创建文件夹的脚本
Intel distiller Toolkit - Quantitative implementation 1
Advanced Computer Network Review(4)——Congestion Control of MPTCP
Go redis initialization connection
UML圖記憶技巧
LeetCode:387. The first unique character in the string
Advanced Computer Network Review(3)——BBR
[oc]- < getting started with UI> -- common controls uibutton