From 6bdc3eb29f8324eef6ed6db96e8c3677a989a1bc Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 20 May 2017 21:21:30 +0200 Subject: [PATCH] workaround for broken tree indicators with Qt 5.6 under Windows --- src/Gui/Application.cpp | 17 +++++++++++++++++ src/Gui/Icons/resource.qrc | 2 ++ src/Gui/Icons/style/windows_branch_closed.png | Bin 0 -> 159 bytes src/Gui/Icons/style/windows_branch_open.png | Bin 0 -> 153 bytes 4 files changed, 19 insertions(+) create mode 100644 src/Gui/Icons/style/windows_branch_closed.png create mode 100644 src/Gui/Icons/style/windows_branch_open.png diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 2de7dce685..cece611c68 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1780,6 +1780,23 @@ void Application::runApplication(void) qApp->sendEvent(&mw, &e); } } +#if QT_VERSION == 0x050600 && defined(Q_OS_WIN32) + else { + // 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 //initialize spaceball. mainApp.initSpaceball(&mw); diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index acbef34ba3..c976aee3aa 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -40,6 +40,8 @@ ClassBrowser/type_class.svg ClassBrowser/type_enum.svg ClassBrowser/type_module.svg + style/windows_branch_closed.png + style/windows_branch_open.png Std_ViewScreenShot.svg bound-expression.svg bound-expression-unset.svg diff --git a/src/Gui/Icons/style/windows_branch_closed.png b/src/Gui/Icons/style/windows_branch_closed.png new file mode 100644 index 0000000000000000000000000000000000000000..d13516d3285d0dc91d3d6b034a551de3d8878e5d GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ(0U`xw#m)r@Bze2LF#HF>1$&oI21yrqL>4nJ z@ErzW#^d=bQh4nJ z@ErzW#^d=bQh5@TtxR3aNRzIEHXsPfj_&@?TN{2sUyq^8Vu< ocCf=&K<%S^w=Itkj|Bt6PGMGN?Q3tdfjSsGUHx3vIVCg!08AJuA^-pY literal 0 HcmV?d00001