1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-14 02:14:21 +01:00

Fix a Qt 4.7 assert when drawing device item backgrounds

This commit is contained in:
David Sansome 2010-09-10 19:59:29 +00:00
parent 7841fff6ad
commit 8f29764817

View File

@ -26,6 +26,7 @@
#include "ui/organisedialog.h"
#include "ui/organiseerrordialog.h"
#include <QApplication>
#include <QContextMenuEvent>
#include <QMenu>
#include <QMessageBox>
@ -50,7 +51,10 @@ void DeviceItemDelegate::paint(QPainter* p, const QStyleOptionViewItem& opt, con
}
// Draw the background
QStyledItemDelegate::paint(p, opt, QModelIndex());
const QStyleOptionViewItemV3* vopt = qstyleoption_cast<const QStyleOptionViewItemV3*>(&opt);
const QWidget* widget = vopt->widget;
QStyle* style = widget->style() ? widget->style() : QApplication::style();
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, p, widget);
p->save();