Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- import QtQuick.Controls 2.0
- Popup {
- id: popup
- modal: false
- focus: false
- property alias text: txt.text
- closePolicy: Popup.NoAutoClose // To close click the notification or wait 5 seconds
- Timer {
- id: timer
- interval: 5000 // milliseconds
- running: true
- repeat: false
- onTriggered: {
- popup.close()
- }
- }
- contentItem: Item {
- implicitWidth: txt.implicitWidth
- implicitHeight: txt.implicitHeight
- anchors.fill: parent
- MouseArea {
- anchors.fill: parent
- onClicked: {
- popup.close()
- }
- }
- Text {
- id: txt
- }
- }
- onOpened: {
- timer.start()
- }
- }
Add Comment
Please, Sign In to add comment