Commit 537a5c00 authored by Friedemann Kleint's avatar Friedemann Kleint

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: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b3ac3ff9
......@@ -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);
......
......@@ -60,7 +60,7 @@ private:
class LayoutPositions
{
public:
LayoutPositions(QStyleOptionViewItemV4 &options, TestResultFilterModel *filterModel)
LayoutPositions(QStyleOptionViewItem &options, TestResultFilterModel *filterModel)
: m_totalWidth(options.rect.width()),
m_top(options.rect.top()),
m_bottom(options.rect.bottom())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment