diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-17 13:22:34 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-28 19:11:13 +0000 |
commit | cac15b14f46e6ac69b72a89f43b96ae5ee212b9a (patch) | |
tree | 95612e4ed52361cdfd07cc233c92534538c44f3e /examples | |
parent | 6873009fde5af86ed82b4aa69016b65dd57d55b9 (diff) |
Hangman Demo: Do not crash on non-mobile platforms
If we don't get the in-app purchases we can still do some things.
Change-Id: I93a1abf3c4cfe0c19cd6d566590ec522db26eecd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7dd98a7b6136d29d3bc8576d940f5e71c941bfbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/demos/hangman/purchasing/inapp/inappstore.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/demos/hangman/purchasing/inapp/inappstore.cpp b/examples/demos/hangman/purchasing/inapp/inappstore.cpp index acce855c6..698ec0ea3 100644 --- a/examples/demos/hangman/purchasing/inapp/inappstore.cpp +++ b/examples/demos/hangman/purchasing/inapp/inappstore.cpp @@ -35,12 +35,13 @@ InAppStore::~InAppStore() void InAppStore::setupBackend() { - #ifdef Q_OS_ANDROID +#if defined Q_OS_ANDROID d->backend = new AndroidInAppPurchaseBackend; - #endif - #ifdef Q_OS_IOS +#elif defined Q_OS_IOS d->backend = new IosInAppPurchaseBackend; - #endif +#else + return; +#endif d->backend->setStore(this); connect(d->backend, &InAppPurchaseBackend::ready, |