From 53d6460558c1f998aa69071d0a6cd9cc58720a98 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Wed, 30 Dec 2020 01:23:57 +0100 Subject: Attempt to fix the style of the drop indicator. --- src/modlistview.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index 9d0335b3..3e8c50e5 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -76,7 +76,7 @@ ModListView::ModListView(QWidget* parent) MOBase::setCustomizableColumns(this); setAutoExpandDelay(1000); - setStyle(new ModListProxyStyle()); + setStyle(new ModListProxyStyle(style())); setItemDelegate(new ModListStyledItemDelegated(this)); } @@ -84,10 +84,13 @@ void ModListView::refresh() { updateGroupByProxy(-1); - // maybe there is a better way but I did not find one - QString sheet = styleSheet(); - setStyleSheet("QTreeView { }"); - setStyleSheet(sheet); + // since we use a proxy, modifying the stylesheet messes things + // up by and this fixes it (force update style and fix drop indicator + // after changing the stylesheet) + if (auto* proxy = qobject_cast(style())) { + auto* s = proxy->baseStyle(); + setStyle(new ModListProxyStyle(s)); + } } void ModListView::setProfile(Profile* profile) -- cgit v1.3.1