当前位置:网站首页>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 .
边栏推荐
- Tdengine biweekly selection of community issues | phase III
- [sword finger offer] serialized binary tree
- I-BERT
- Advanced Computer Network Review(3)——BBR
- CUDA实现focal_loss
- Advanced Computer Network Review(5)——COPE
- ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
- Intel distiller Toolkit - Quantitative implementation 1
- Five layer network architecture
- BMINF的後訓練量化實現
猜你喜欢
LeetCode:498. Diagonal traversal
甘肃旅游产品预订增四倍:“绿马”走红,甘肃博物馆周边民宿一房难求
Once you change the test steps, write all the code. Why not try yaml to realize data-driven?
Pytest's collection use case rules and running specified use cases
[three storage methods of graph] just use adjacency matrix to go out
[OC]-<UI入门>--常用控件的学习
[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)
In depth analysis and encapsulation call of requests
Post training quantification of bminf
Simclr: comparative learning in NLP
随机推荐
[shell script] use menu commands to build scripts for creating folders in the cluster
[Hacker News Weekly] data visualization artifact; Top 10 Web hacker technologies; Postman supports grpc
What is an R-value reference and what is the difference between it and an l-value?
Booking of tourism products in Gansu quadrupled: "green horse" became popular, and one room of B & B around Gansu museum was hard to find
Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
LeetCode:214. 最短回文串
KDD 2022 paper collection (under continuous update)
LeetCode:236. The nearest common ancestor of binary tree
LeetCode:41. Missing first positive number
Niuke winter vacation training 6 maze 2
数字人主播618手语带货,便捷2780万名听障人士
I-BERT
A convolution substitution of attention mechanism
[OC foundation framework] - string and date and time >
Connexion d'initialisation pour go redis
Leetcode problem solving 2.1.1
数学建模2004B题(输电问题)
CSP salary calculation
甘肃旅游产品预订增四倍:“绿马”走红,甘肃博物馆周边民宿一房难求
KDD 2022论文合集(持续更新中)