From b4d24fbe6d4b65b4da551e380cc1fb89458b75b6 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 3 Feb 2018 14:44:53 +0100 Subject: Do not cascade style sheets to QMenu Just a one line change, but a hard one. The SearchDialog context menu looked quite strange after applying the style sheet for alternating row colors. Qt inherits them to all child objects, but that's not what we want. So restrict it to QTreeViews. --- helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index 08b8532..73699f8 100644 --- a/helper.cpp +++ b/helper.cpp @@ -163,7 +163,7 @@ namespace Helper { if(alternate){ QColor b = s.value("basecolor").value(); QColor a = s.value("altcolor").value(); - QString style = QString("background-color: rgb(%1,%2,%3);alternate-background-color: rgb(%4,%5,%6);").arg(b.red()).arg(b.green()).arg(b.blue()).arg(a.red()).arg(a.green()).arg(a.blue()); + QString style = QString("QTreeView { background-color: rgb(%1,%2,%3);alternate-background-color: rgb(%4,%5,%6); }").arg(b.red()).arg(b.green()).arg(b.blue()).arg(a.red()).arg(a.green()).arg(a.blue()); QVector views = Globals::instance()->views(); for(QTreeView *v : views){ v->setAlternatingRowColors(true); -- cgit v1.2.3-70-g09d2