forked from qt-creator/qt-creator
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:
@@ -48,6 +48,7 @@
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QPainter>
|
||||
#include <QStackedWidget>
|
||||
#include <QTimer>
|
||||
@@ -310,6 +311,12 @@ WelcomeMode::WelcomeMode()
|
||||
layout->addWidget(new StyledBar(m_modeWidget));
|
||||
layout->addItem(hbox);
|
||||
|
||||
if (Utils::HostOsInfo::isMacHost()) { // workaround QTBUG-61384
|
||||
auto openglWidget = new QOpenGLWidget;
|
||||
openglWidget->hide();
|
||||
layout->addWidget(openglWidget);
|
||||
}
|
||||
|
||||
setWidget(m_modeWidget);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user