• RhythmGameQml
  • PendingReplyGroup
  • PendingReplyGroup QML Type

    Cancels a set of asynchronous requests together. More...

    Import Statement: import RhythmGameQml

    Properties

    Methods

    Detailed Description

    Use one group for requests that should be cancelled together, such as data for the currently selected chart. Call cancelAll before loading a new selection. Finished replies leave the group automatically; destroying the group cancels any unfinished replies.

    track returns the same reply, so the caller can still use its then() method. This helper requests a full score belonging to the main profile and cancels the previous request:

    import QtQuick
    import RhythmGameQml
    
    Item {
        PendingReplyGroup { id: scoreReplies }
    
        function requestScore(result) {
            scoreReplies.cancelAll();
            return scoreReplies.track(
                Rg.profileList.mainProfile.scoreDb.getScore(result));
        }
    }

    For an ordinary score display, use ScoreDetails instead. It also tracks the selected result, profile and loading state.

    A reply must provide a resultAvailable property, a finished signal and a cancel() method. Null and already-finished replies are returned unchanged and are not retained. Disabling the group does not cancel its requests; call cancelAll when your custom flow needs that behavior.

    Property Documentation

    count : int [read-only]

    Number of unfinished replies currently owned by the group.


    Method Documentation

    cancelAll()

    Cancels and releases every unfinished reply owned by the group.


    track(reply)

    Retains reply until it finishes or the group cancels it.