Commit aded97cd authored by hjk's avatar hjk
Browse files

Remove more uses of deprecated QStyleOptionViewItemV4



Change-Id: I5b8463e3f5d2d4688865987bf03cfc569fd5fc19
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent ff502ba6
......@@ -118,7 +118,7 @@ public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
painter->save();
......@@ -222,7 +222,7 @@ public:
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
QFontMetrics fm(option.font);
......
......@@ -125,7 +125,7 @@ QColor ConsoleItemDelegate::drawBackground(QPainter *painter, const QRect &rect,
void ConsoleItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
painter->save();
......@@ -253,7 +253,7 @@ void ConsoleItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
QSize ConsoleItemDelegate::sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
const QTreeView *view = qobject_cast<const QTreeView *>(opt.widget);
......@@ -343,8 +343,7 @@ void ConsoleItemDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &/*index*/) const
{
QStyleOptionViewItemV4 opt = option;
editor->setGeometry(QRect(opt.rect.x(), opt.rect.top(), opt.rect.width(), opt.rect.bottom()));
editor->setGeometry(QRect(option.rect.x(), option.rect.top(), option.rect.width(), option.rect.bottom()));
}
void ConsoleItemDelegate::currentChanged(const QModelIndex &current,
......
......@@ -124,7 +124,7 @@ CostDelegate::CostFormat CostDelegate::format() const
void CostDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt(option);
QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
......@@ -157,7 +157,7 @@ void CostDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
QSize CostDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItemV4 opt(option);
QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
const QString text = d->displayText(index, opt.locale);
......
Supports Markdown
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