Remove casting of QStyleOptionViewItems to set data.

The correct values are already set inside setOptions, because the
multiple versions of QStyleOptionViewItem were squashed in Qt 5.

Change-Id: If0faf4b35bbf476e00905905376868814b8b095a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Stephen Kelly 2012-09-19 17:34:12 +02:00 committed by The Qt Project
parent 89d9f8fe94
commit 509ab6375e

View File

@ -418,14 +418,7 @@ void QItemDelegate::paint(QPainter *painter,
Q_D(const QItemDelegate);
Q_ASSERT(index.isValid());
QStyleOptionViewItemV4 opt = setOptions(index, option);
const QStyleOptionViewItemV2 *v2 = qstyleoption_cast<const QStyleOptionViewItemV2 *>(&option);
opt.features = v2 ? v2->features
: QStyleOptionViewItemV2::ViewItemFeatures(QStyleOptionViewItemV2::None);
const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3 *>(&option);
opt.locale = v3 ? v3->locale : QLocale();
opt.widget = v3 ? v3->widget : 0;
QStyleOptionViewItem opt = setOptions(index, option);
// prepare
painter->save();