From 1ec3e5da8248d05622355a7a69ed6cfdaff171fd Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 21 May 2017 10:02:26 +0200 Subject: [PATCH] workaround for broken tree indicators with Qt 5.6 under Windows --- src/Gui/DlgGeneralImp.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index bfb841753a..0ec847af0d 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -195,6 +195,22 @@ void DlgGeneralImp::saveSettings() qApp->sendEvent(getMainWindow(), &e); mdi->setBackground(QBrush(QColor(160,160,160))); } + +#if QT_VERSION == 0x050600 && defined(Q_OS_WIN32) + // Under Windows the tree indicator branch gets corrupted after a while. + // For more details see also https://bugreports.qt.io/browse/QTBUG-52230 + // and https://codereview.qt-project.org/#/c/154357/2//ALL,unified + // A workaround for Qt 5.6.0 is to set a minimal style sheet. + QString qss = QString::fromLatin1( + "QTreeView::branch:closed:has-children {\n" + " image: url(:/icons/style/windows_branch_closed.png);\n" + "}\n" + "\n" + "QTreeView::branch:open:has-children {\n" + " image: url(:/icons/style/windows_branch_open.png);\n" + "}\n"); + qApp->setStyleSheet(qss); +#endif } if (mdi->style())