Autotest: Use QStyleOptionViewItem instead of QStyleOptionViewItemV4.

Fixes warnings:
warning: 'QStyleOptionViewItemV4' is deprecated (declared at ../../../../qt-dev/qtbase/include/QtWidgets/../../src/widgets/styles/qstyleoption.h:390) [-Wdeprecated-declarations]

Change-Id: I41683dc7f449b7e738a6e058b8c0a1e051da6c50
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
Friedemann Kleint
2016-02-03 13:37:34 +01:00
parent b3ac3ff933
commit 537a5c0067
2 changed files with 4 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ QString TestResultDelegate::outputString(const TestResult &testResult, bool sele
void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
// make sure we paint the complete delegate instead of keeping an offset
opt.rect.adjust(-opt.rect.x(), 0, 0, 0);
@@ -113,7 +113,7 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
const TestResult &testResult = resultFilterModel->testResult(index);
// draw the indicator by ourself as we paint across it with the delegate
QStyleOptionViewItemV4 indicatorOpt = option;
QStyleOptionViewItem indicatorOpt = option;
indicatorOpt.rect = QRect(0, opt.rect.y(), positions.indentation(), opt.rect.height());
opt.widget->style()->drawPrimitive(QStyle::PE_IndicatorBranch, &indicatorOpt, painter);
@@ -174,7 +174,7 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
// make sure opt.rect is initialized correctly - otherwise we might get a width of 0
opt.initFrom(opt.widget);
initStyleOption(&opt, index);