diff options
Diffstat (limited to 'src/quick/items/qquickpaletteproviderprivatebase_p.h')
-rw-r--r-- | src/quick/items/qquickpaletteproviderprivatebase_p.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/quick/items/qquickpaletteproviderprivatebase_p.h b/src/quick/items/qquickpaletteproviderprivatebase_p.h index 8f8251f251..a600a23ce6 100644 --- a/src/quick/items/qquickpaletteproviderprivatebase_p.h +++ b/src/quick/items/qquickpaletteproviderprivatebase_p.h @@ -344,10 +344,21 @@ void QQuickPaletteProviderPrivateBase<I, Impl>::setCurrentColorGroup() template<class I, class Impl> void QQuickPaletteProviderPrivateBase<I, Impl>::updateChildrenPalettes(const QPalette &parentPalette) { - if (auto root = rootItem(*itemWithPalette())) { - for (auto &&child : root->childItems()) { - if (Q_LIKELY(child)) { - getPrivate(*child)->inheritPalette(parentPalette); + if constexpr (std::is_same_v<QQuickWindow, I> && std::is_same_v<QQuickWindowPrivate, Impl>) { + /* QQuickWindowPrivate instantiates this template, but does not include QQuickItemPrivate + * This causes an error with the QQuickItemPrivate::inheritPalette call below on MSVC in + * static builds, as QQuickItemPrivate is incomplete. To work around this situation, we do + * nothing in this instantiation of updateChildrenPalettes and instead add an override in + * QQuickWindowPrivate, which does the correct thing. + */ + Q_UNREACHABLE(); // You are not supposed to call this function + return; + } else { + if (auto root = rootItem(*itemWithPalette())) { + for (auto &&child : root->childItems()) { + if (Q_LIKELY(child)) { + getPrivate(*child)->inheritPalette(parentPalette); + } } } } |