Work around slow painting on macOS

This got prominent by removing the OpenGL based QQuickWidget from the
Welcome mode.
Basically painting is very slow to the point of unusable when there is
no OpenGL widget in a window. The moment an OpenGL widget is in the
widget hierarchy of a window, painting is much faster. This is
especially notable on HiDPI screens, e.g. using 1.5x or 1x scaling on 4k
monitors.
This is also reproducible with older versions of Qt Creator when using
additional editor windows or diabling Welcome mode.

Restore the status quo by adding a dummy OpenGL widget to welcome mode
on macOS.

Task-number: QTBUG-61384
Change-Id: Ia1a4738dd2070d70d8be42d4d717099d3933248b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
Eike Ziller
2017-06-13 11:02:58 +02:00
parent 460e1d7e93
commit 937bb39ff2

View File

@@ -48,6 +48,7 @@
#include <QHeaderView> #include <QHeaderView>
#include <QLabel> #include <QLabel>
#include <QMouseEvent> #include <QMouseEvent>
#include <QOpenGLWidget>
#include <QPainter> #include <QPainter>
#include <QStackedWidget> #include <QStackedWidget>
#include <QTimer> #include <QTimer>
@@ -310,6 +311,12 @@ WelcomeMode::WelcomeMode()
layout->addWidget(new StyledBar(m_modeWidget)); layout->addWidget(new StyledBar(m_modeWidget));
layout->addItem(hbox); layout->addItem(hbox);
if (Utils::HostOsInfo::isMacHost()) { // workaround QTBUG-61384
auto openglWidget = new QOpenGLWidget;
openglWidget->hide();
layout->addWidget(openglWidget);
}
setWidget(m_modeWidget); setWidget(m_modeWidget);
} }