Home > database >  QML BusyIndicator how to overlay the current window, like ProgressDialog in Android
QML BusyIndicator how to overlay the current window, like ProgressDialog in Android

Time:09-24

Iam using QML Busyindicator when a user login or loading a data in a page or something like this, I want to be able to make the busyindicator overlay over the current window and make the window not editable, something similar to the messagebox when it shows up and disables all the Window, so I cant interact with the widgets on this window until the loading finish, something like the ProgressDialog in Android.

this is my code and what I try to do, also I tried to use MessageDialog and use this indicator inside it and remove all buttons, but it does not work.

Popup {
    id: waitpop
    width: 100
    height: 100
    BusyIndicator {
        id: login_progress
        running: true
        anchors.fill: parent
    }
    anchors.centerIn: Overlay.overlay
    closePolicy: Popup.NoAutoClose
}

this code shows the busy indicator but the user still can interact with the button and text field and everything, so any ideas?

CodePudding user response:

The modal property prevents you from being able to click outside the popup.

Popup {
    anchors.centerIn: Overlay.overlay
    closePolicy: Popup.NoAutoClose
    modal: true

    BusyIndicator {
        running: true
    }
}
  • Related