Fix QProxyStyle

This commit is contained in:
Jonas Kvinge 2020-01-02 18:57:53 +01:00
parent 3696ae44ad
commit 7f442cff3b
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -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 {