Important: Please read the Qt Code of Conduct -

QtPurchasing and Product.resetStatus()

  • Hi, I am trying to re-fetch in-app products and found a method resetStatus in Product type. But I am getting runtime error when I am calling product.resetStatus() :

    qrc:///main.qml:2074: TypeError: Property 'resetStatus' of object QQuickItem_QML_62(0x228a639e410) is not a function

    product.purchase() and everything else works fine.

    Documentation states: This method was introduced in QtPurchasing 1.0.2.
    How to enable this method in my project?

    PS. I tried Qt 5.11.1 and Qt 5.10.1 with no luck.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Not a direct answer as I haven't used that module but from your description, wouldn't the Store.restorePurchases method be what you are looking for ?

  • No, sorry, restorePurchases is useful too, but I need to re-fetch products, which were not fetched because of no internet connection or connection timeouts when app started.

    I see this method in \qml\QtPurchasing\plugins.qmltypes but when I am downloaded QtPurchasing source code, resetStatus is only declared in qinappproductqmltype_p.h

    I guess it is private header. But documentation states it is ok to use resetStatus:

  • Lifetime Qt Champion

    Can you show the code you are using that is failing ?

Log in to reply