From 23525e2a648a23f099c2b533aa91839a2f8e829f Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 16 Oct 2019 15:50:45 +0800 Subject: Some dumb style plugins assume a parameter that defaults to null to be non-null. --- qmidiplayer-desktop/qmpchannelswindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index fe0eeff..13f2c8d 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -177,8 +177,8 @@ void qmpDeviceItemDelegate::paint(QPainter*painter,const QStyleOptionViewItem&op socb.editable=false; socb.rect=option.rect; socb.state=opt.state; - par->style()->drawComplexControl(QStyle::ComplexControl::CC_ComboBox,&socb,painter); - par->style()->drawControl(QStyle::CE_ComboBoxLabel,&socb,painter); + par->style()->drawComplexControl(QStyle::ComplexControl::CC_ComboBox,&socb,painter,option.widget); + par->style()->drawControl(QStyle::CE_ComboBoxLabel,&socb,painter,option.widget); } QSize qmpDeviceItemDelegate::sizeHint(const QStyleOptionViewItem&option,const QModelIndex&index)const { @@ -189,7 +189,7 @@ QSize qmpDeviceItemDelegate::sizeHint(const QStyleOptionViewItem&option,const QM socb.editable=false; socb.rect=option.rect; QSize sz=par->fontMetrics().size(Qt::TextFlag::TextSingleLine,socb.currentText); - return par->style()->sizeFromContents(QStyle::ContentsType::CT_ComboBox,&socb,sz); + return par->style()->sizeFromContents(QStyle::ContentsType::CT_ComboBox,&socb,sz,option.widget); } QWidget* qmpDeviceItemDelegate::createEditor(QWidget*parent,const QStyleOptionViewItem&option,const QModelIndex&index)const { -- cgit v1.2.3