- Qt 5.15
- Qt Purchasing
- QML Types
- Store QML Type
- Qt 5.15.19 Reference Documentation

# Store QML Type

Access point to the external market place for in-app purchases. More...

Import Statement: | import QtPurchasing 1.15
Since: | QtPurchasing 1.0

- List of all members, including inherited members

## Methods

- restorePurchases()

## Detailed Description

When using the Qt Purchasing API in QML, the application should instantiate one Store and then instantiate products as children of this store. The products created as children of the Store object will automatically be queried from the external market place if one is available on the current platform.

The following example registers a store with three products, two consumable products and one unlockable.

     Store {
         Product {
             identifier: "myConsumableProduct1"
             type: Product.Consumable

             // ...
         }

         Product {
             identifier: "myConsumableProduct2"
             type: Product.Consumable

             // ...
         }

         Product {
             identifier: "myUnlockableProduct"
             type: Product.Unlockable

             // ...
         }

         // ...
     }

## Method Documentation

restorePurchases()

Calling this method will cause onPurchaseRestored handlers to be called asynchronously on previously purchased unlockable products. This can be used to restore purchases for unlockable products when the application is run by the same user on multiple devices, or for example if the application has been uninstalled and reinstalled on the device so that the purchase data has been lost.

Note: On some platforms, such as iOS, this will require the user to input their password to launch the restore process. On other platforms, such as Android, it is not typically needed, as the onPurchaseSucceeded handler will be called on any previously purchased unlockable product if the application data is removed.