当前位置:网站首页>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 .
边栏推荐
- 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
- Connexion d'initialisation pour go redis
- CUDA实现focal_loss
- Redis之核心配置
- UML圖記憶技巧
- In depth analysis and encapsulation call of requests
- Export IEEE document format using latex
- Tdengine biweekly selection of community issues | phase III
- Multivariate cluster analysis
- 【每日一题】搬运工 (DFS / DP)
猜你喜欢

Ijcai2022 collection of papers (continuously updated)

Intel distiller Toolkit - Quantitative implementation 1

LeetCode:236. The nearest common ancestor of binary tree

一改测试步骤代码就全写 为什么不试试用 Yaml实现数据驱动?

Different data-driven code executes the same test scenario

Nacos installation and service registration

Alibaba cloud server mining virus solution (practiced)

CUDA implementation of self defined convolution attention operator

After reading the programmer's story, I can't help covering my chest...

Redis之核心配置
随机推荐
I-BERT
LeetCode:673. Number of longest increasing subsequences
Post training quantification of bminf
【文本生成】论文合集推荐丨 斯坦福研究者引入时间控制方法 长文本生成更流畅
Advance Computer Network Review(1)——FatTree
CUDA implementation of self defined convolution attention operator
Redis之Bitmap
Leetcode: Sword finger offer 48 The longest substring without repeated characters
Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
Advanced Computer Network Review(5)——COPE
数字人主播618手语带货,便捷2780万名听障人士
[OC-Foundation框架]-<字符串And日期与时间>
An article takes you to understand the working principle of selenium in detail
Advanced Computer Network Review(3)——BBR
LeetCode:394. String decoding
【shell脚本】——归档文件脚本
Reids之删除策略
【剑指offer】序列化二叉树
LeetCode:387. The first unique character in the string
Intel Distiller工具包-量化实现1