From 7f442cff3b4af7c6fd128065ee88e0d9ad3f2720 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 2 Jan 2020 18:57:53 +0100 Subject: [PATCH] Fix QProxyStyle --- src/moodbar/moodbarproxystyle.cpp | 3 ++- src/playlist/playlistview.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/moodbar/moodbarproxystyle.cpp b/src/moodbar/moodbarproxystyle.cpp index 9712985be..4b86de184 100644 --- a/src/moodbar/moodbarproxystyle.cpp +++ b/src/moodbar/moodbarproxystyle.cpp @@ -40,7 +40,7 @@ const int MoodbarProxyStyle::kArrowWidth = 17; const int MoodbarProxyStyle::kArrowHeight = 13; MoodbarProxyStyle::MoodbarProxyStyle(Application* app, QSlider* slider) - : QProxyStyle(slider->style()), + : QProxyStyle(nullptr), app_(app), slider_(slider), enabled_(true), @@ -53,6 +53,7 @@ MoodbarProxyStyle::MoodbarProxyStyle(Application* app, QSlider* slider) show_moodbar_action_(nullptr), style_action_group_(nullptr) { + setBaseStyle(slider->style()); slider->setStyle(this); slider->installEventFilter(this); diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 7cf0a0d80..218e78f28 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -91,7 +91,12 @@ const int PlaylistView::kDropIndicatorWidth = 2; const int PlaylistView::kDropIndicatorGradientWidth = 5; PlaylistProxyStyle::PlaylistProxyStyle(QStyle *base) - : QProxyStyle(base), common_style_(new QCommonStyle) {} + : QProxyStyle(nullptr), + common_style_(new QCommonStyle) { + + setBaseStyle(base); + +} void PlaylistProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const {