Fix kUseNativeChild with Qt 6.4+
This commit is contained in:
parent
79b6cd347c
commit
7c9aa94533
1 changed files with 10 additions and 1 deletions
|
|
@ -24,6 +24,15 @@ namespace {
|
||||||
|
|
||||||
constexpr auto kUseNativeChild = false;// ::Platform::IsWindows();
|
constexpr auto kUseNativeChild = false;// ::Platform::IsWindows();
|
||||||
|
|
||||||
|
class RpWidgetNoRhi : public RpWidget {
|
||||||
|
protected:
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||||
|
std::optional<QPlatformBackingStoreRhiConfig> rhiConfig() const override {
|
||||||
|
return QPlatformBackingStoreRhiConfig();
|
||||||
|
}
|
||||||
|
#endif // Qt >= 6.4.0
|
||||||
|
};
|
||||||
|
|
||||||
class RpWindowNoRhi : public RpWindow {
|
class RpWindowNoRhi : public RpWindow {
|
||||||
protected:
|
protected:
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||||
|
|
@ -87,7 +96,7 @@ std::unique_ptr<RpWidget> Window::createNativeBodyWrap(
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
const auto create = [] {
|
const auto create = [] {
|
||||||
auto result = std::make_unique<RpWidget>();
|
auto result = std::make_unique<RpWidgetNoRhi>();
|
||||||
result->setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
|
result->setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
|
||||||
result->setAttribute(Qt::WA_NativeWindow);
|
result->setAttribute(Qt::WA_NativeWindow);
|
||||||
result->setAttribute(Qt::WA_DontCreateNativeAncestors);
|
result->setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue