summaryrefslogtreecommitdiffstats
path: root/application/groupview
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-21 20:20:37 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-21 20:20:37 +0200
commit8bd8be95f027b22a09724a48a3d8d9f2481e7f95 (patch)
tree1b0af581d904e3fbaaf3cf9493f1f8b038e83cec /application/groupview
parent572a6026b57804cd8e9c3a4ccf4dcb1d198b46c7 (diff)
downloadMultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.gz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.lz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.tar.xz
MultiMC-8bd8be95f027b22a09724a48a3d8d9f2481e7f95.zip
NOISSUE fix a bunch of compiler warnings
Diffstat (limited to 'application/groupview')
-rw-r--r--application/groupview/GroupView.cpp5
-rw-r--r--application/groupview/InstanceDelegate.cpp16
2 files changed, 10 insertions, 11 deletions
diff --git a/application/groupview/GroupView.cpp b/application/groupview/GroupView.cpp
index 75d50483..ec5f409a 100644
--- a/application/groupview/GroupView.cpp
+++ b/application/groupview/GroupView.cpp
@@ -407,7 +407,7 @@ void GroupView::paintEvent(QPaintEvent *event)
QPainter painter(this->viewport());
- QStyleOptionViewItemV4 option(viewOptions());
+ QStyleOptionViewItem option(viewOptions());
option.widget = this;
int wpWidth = viewport()->width();
@@ -437,8 +437,7 @@ void GroupView::paintEvent(QPaintEvent *event)
}
Qt::ItemFlags flags = index.flags();
option.rect = visualRect(index);
- option.features |=
- QStyleOptionViewItemV2::WrapText; // FIXME: what is the meaning of this anyway?
+ option.features |= QStyleOptionViewItem::WrapText;
if (flags & Qt::ItemIsSelectable && selectionModel()->isSelected(index))
{
option.state |= selectionModel()->isSelected(index) ? QStyle::State_Selected
diff --git a/application/groupview/InstanceDelegate.cpp b/application/groupview/InstanceDelegate.cpp
index ffeb256f..10e31178 100644
--- a/application/groupview/InstanceDelegate.cpp
+++ b/application/groupview/InstanceDelegate.cpp
@@ -52,7 +52,7 @@ ListViewDelegate::ListViewDelegate(QObject *parent) : QStyledItemDelegate(parent
{
}
-void drawSelectionRect(QPainter *painter, const QStyleOptionViewItemV4 &option,
+void drawSelectionRect(QPainter *painter, const QStyleOptionViewItem &option,
const QRect &rect)
{
if ((option.state & QStyle::State_Selected))
@@ -65,7 +65,7 @@ void drawSelectionRect(QPainter *painter, const QStyleOptionViewItemV4 &option,
}
}
-void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect)
+void drawFocusRect(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect)
{
if (!(option.state & QStyle::State_HasFocus))
return;
@@ -89,7 +89,7 @@ void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, cons
}
// TODO this can be made a lot prettier
-void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option,
+void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItem &option,
const int value, const int maximum)
{
if (maximum == 0 || value == maximum)
@@ -109,7 +109,7 @@ void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option
painter->restore();
}
-void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance, QIcon::Mode mode, QIcon::State state)
+void drawBadges(QPainter *painter, const QStyleOptionViewItem &option, BaseInstance *instance, QIcon::Mode mode, QIcon::State state)
{
QList<QString> pixmaps;
if (instance->isRunning())
@@ -156,7 +156,7 @@ void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseIns
painter->translate(-option.rect.topLeft());
}
-static QSize viewItemTextSize(const QStyleOptionViewItemV4 *option)
+static QSize viewItemTextSize(const QStyleOptionViewItem *option)
{
QStyle *style = option->widget ? option->widget->style() : QApplication::style();
QTextOption textOption;
@@ -177,7 +177,7 @@ static QSize viewItemTextSize(const QStyleOptionViewItemV4 *option)
void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
- QStyleOptionViewItemV4 opt = option;
+ QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
painter->save();
painter->setClipRect(opt.rect);
@@ -205,7 +205,7 @@ void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
// FIXME: unused
// QSize textSize = viewItemTextSize ( &opt );
QPalette::ColorGroup cg;
- QStyleOptionViewItemV4 opt2(opt);
+ QStyleOptionViewItem opt2(opt);
if ((opt.widget && opt.widget->isEnabled()) || (opt.state & QStyle::State_Enabled))
{
@@ -323,7 +323,7 @@ void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
- QStyleOptionViewItemV4 opt = option;
+ QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
opt.features |= QStyleOptionViewItem::WrapText;
opt.text = index.data().toString();