当前位置:网站首页>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 .
边栏推荐
- requests的深入刨析及封装调用
- LeetCode:387. The first unique character in the string
- Leetcode: Jianzhi offer 03 Duplicate numbers in array
- LeetCode41——First Missing Positive——hashing in place & swap
- LeetCode:34. Find the first and last positions of elements in a sorted array
- Pytest参数化你不知道的一些使用技巧 /你不知道的pytest
- LeetCode:498. 对角线遍历
- MYSQL卸载方法与安装方法
- LeetCode:26. Remove duplicates from an ordered array
- Intel Distiller工具包-量化实现3
猜你喜欢
[oc foundation framework] - < copy object copy >
ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
QDialog
SAP ui5 date type sap ui. model. type. Analysis of the parsing format of date
Digital people anchor 618 sign language with goods, convenient for 27.8 million people with hearing impairment
Different data-driven code executes the same test scenario
Export IEEE document format using latex
Simclr: comparative learning in NLP
Nacos installation and service registration
KDD 2022 paper collection (under continuous update)
随机推荐
In depth analysis and encapsulation call of requests
Implement window blocking on QWidget
【图的三大存储方式】只会用邻接矩阵就out了
LeetCode:498. 对角线遍历
甘肃旅游产品预订增四倍:“绿马”走红,甘肃博物馆周边民宿一房难求
自定义卷积注意力算子的CUDA实现
[OC foundation framework] - [set array]
数学建模2004B题(输电问题)
Once you change the test steps, write all the code. Why not try yaml to realize data-driven?
After reading the programmer's story, I can't help covering my chest...
力扣每日一题(二)
Improved deep embedded clustering with local structure preservation (Idec)
LeetCode:39. Combined sum
Connexion d'initialisation pour go redis
LeetCode:673. Number of longest increasing subsequences
CUDA implementation of self defined convolution attention operator
LeetCode:836. Rectangle overlap
Selenium+pytest automated test framework practice (Part 2)
[OC foundation framework] - string and date and time >
随手记01