From fd6ba0e2a6fd9650d6a287ea0d55d5b97bedc8ad Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@theqtcompany.com> Date: Wed, 17 Dec 2014 18:16:41 +0100 Subject: [PATCH] OS X: Welcome/QQuickWidget fixes The rendered text is still ugly, but the fuzzy text is better than the alternative currently. Change-Id: Id9e54fb406ee964e0b9b5c40b7a8108b45c15f85 Task-number: QTBUG-42861 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> --- share/qtcreator/welcomescreen/widgets/NativeText.qml | 2 +- src/plugins/help/macwebkithelpviewer.mm | 3 +++ src/plugins/welcome/welcomeplugin.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/welcomescreen/widgets/NativeText.qml b/share/qtcreator/welcomescreen/widgets/NativeText.qml index f1119b8ecc1..df11fe3bf36 100644 --- a/share/qtcreator/welcomescreen/widgets/NativeText.qml +++ b/share/qtcreator/welcomescreen/widgets/NativeText.qml @@ -31,7 +31,7 @@ import QtQuick 2.1 Text { - renderType: Text.NativeRendering + renderType: useNativeText ? Text.NativeRendering : Text.QtRendering Accessible.name: text Accessible.role: Accessible.StaticText } diff --git a/src/plugins/help/macwebkithelpviewer.mm b/src/plugins/help/macwebkithelpviewer.mm index 6fe80ab61ff..7f583f145d2 100644 --- a/src/plugins/help/macwebkithelpviewer.mm +++ b/src/plugins/help/macwebkithelpviewer.mm @@ -415,6 +415,9 @@ MacWebKitHelpWidget::MacWebKitHelpWidget(MacWebKitHelpViewer *parent) { AutoreleasePool pool; Q_UNUSED(pool) d->m_webView = [[MyWebView alloc] init]; + // Turn layered rendering on. + // Otherwise the WebView will render empty after any QQuickWidget was shown. + d->m_webView.wantsLayer = YES; d->m_frameLoadDelegate = [[FrameLoadDelegate alloc] initWithMainFrame:d->m_webView.mainFrame viewer:parent]; [d->m_webView setFrameLoadDelegate:d->m_frameLoadDelegate]; diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 2d26a2393aa..ff79058a767 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -155,7 +155,6 @@ WelcomeMode::WelcomeMode() #endif // USE_QUICK_WIDGET connect(PluginManager::instance(), SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*))); - setWidget(m_modeWidget); } @@ -260,6 +259,13 @@ void WelcomeMode::initPlugins() connect(Core::ICore::instance(), &Core::ICore::themeChanged, this, &WelcomeMode::onThemeChanged); ctx->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties); +#if defined(USE_QUICK_WIDGET) + bool useNativeText = !Utils::HostOsInfo::isMacHost(); +#else + bool useNativeText = true; +#endif + ctx->setContextProperty(QLatin1String("useNativeText"), useNativeText); + QString path = resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml"); // finally, load the root page -- GitLab