Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------
- // rounded shadowed popup
- //
- import QtQuick 2.0
- import QtQuick.Window 2.2
- import QtQuick.Controls 2.3
- import QtGraphicalEffects 1.0
- ApplicationWindow {
- id: window
- width: 400
- height: 400
- visible: true
- Rectangle {
- id: rectMain;
- width: parent.width
- height: parent.height
- Button {
- text: "Open"
- onClicked: popup.open()
- }
- Popup {
- id: popup
- x: 100
- y: 100
- width: 200
- height: 300
- modal: true
- focus: true
- closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
- /* Overlay.modal: GaussianBlur {
- source: ShaderEffectSource {
- sourceItem: window.contentItem
- live: false
- }
- radius: 8
- samples: 16
- }
- */
- padding: 0
- Rectangle {
- id: popRect;
- color: "red";
- width: parent.width
- height: parent.height
- layer.enabled: true
- layer.effect: OpacityMask {
- maskSource: Rectangle {
- id: opMask
- width: popRect.width
- height: popRect.height
- radius: 18
- }
- }
- }
- background: DropShadow {
- source: popup.contentItem
- horizontalOffset: 0
- verticalOffset: 0
- radius: 10
- samples: 7
- color: "black"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement