我试图创建一个全局类,以便我可以在任何地方访问它,但它不起作用,我收到错误:
a storage class can only be specified for objects and functions
有谁知道我要去哪里错了?
这是我的 h 文件:
extern class Payments : public QObject
{
Q_OBJECT
public:
Payments(QObject *parent = 0);
virtual ~Payments();
void purchase(const QString &id, const QString &sku, const QString &name, const QString &metadata);
void getExisting(bool refresh);
void getPrice(const QString &id, const QString &sku);
public slots:
void purchaseResponse();
void existingPurchasesResponse();
void priceResponse();
signals:
void purchaseResponseSuccess(const QString &receiptString);
void existingPurchasesResponseSuccess(const QString &receiptsString);
void priceResponseSuccess(const QString &price);
void infoResponseError(int errorCode, const QString &errorText);
private:
bb::platform::PaymentManager *paymentManager;
};