diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-10-16 15:50:45 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-10-16 15:50:45 +0800 |
commit | 23525e2a648a23f099c2b533aa91839a2f8e829f (patch) | |
tree | 8847049ca3656ad871fbe0027f84cb342dc4c3f1 | |
parent | 3b741fa98af5a2e93915a1b12c8c07f17905ecbe (diff) | |
download | QMidiPlayer-23525e2a648a23f099c2b533aa91839a2f8e829f.tar.xz |
Some dumb style plugins assume a parameter that defaults to null to be non-null.
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 6 |
1 files 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 { |