summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-12-30 01:23:57 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:16 +0100
commit53d6460558c1f998aa69071d0a6cd9cc58720a98 (patch)
tree40d16192e2a31aa1bf7b2c674216b3da51a7d358
parentf906229a914d62d62f8a322375b4693ced2f8f32 (diff)
Attempt to fix the style of the drop indicator.
-rw-r--r--src/modlistview.cpp13
1 files changed, 8 insertions, 5 deletions
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<QProxyStyle*>(style())) {
+ auto* s = proxy->baseStyle();
+ setStyle(new ModListProxyStyle(s));
+ }
}
void ModListView::setProfile(Profile* profile)