From 8512ed1a06888a98f71367f4ac3da3f6edc945c3 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 3 Feb 2018 08:02:05 +0100 Subject: Implement alternating row colors Once again, surprisingly difficult, as you can see on the number of changed files. Coding the configuration options wasn't that difficult, but actually using them was. As it turned out, the default style on Windows doesn't use QApplication::palette() at all, though it does honor setAlternatingRowColors(). It just doesn't use the palette colors, but style sheets. Took me a while to figure out. So, there's always another layer of indirection: First, add all QTreeViews to Globals::views, then create a helper to set the style sheet. --- helper.h | 1 + 1 file changed, 1 insertion(+) (limited to 'helper.h') diff --git a/helper.h b/helper.h index c8982b4..4883a5f 100644 --- a/helper.h +++ b/helper.h @@ -13,6 +13,7 @@ namespace Helper { const QImage snapshot(const QString &file, int offset); const QString appDataDir(); const QIcon icon(const QColor &bg, const QChar c, bool bold = true); + void setAlternatingRowColors(); class Duration { public: Duration(); -- cgit v1.2.3-70-g09d2