summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-01-31 22:58:57 +0100
committerPetr Mrázek <peterix@gmail.com>2014-01-31 22:58:57 +0100
commit179451d5911ccce569492717b1f0b0186e25cab9 (patch)
tree71ed2059301249f11751c17ee3505d24f0ad14af
parent3fb7a0faf069fdc5a4f14a12dfd76c43819c3378 (diff)
downloadMultiMC-179451d5911ccce569492717b1f0b0186e25cab9.tar
MultiMC-179451d5911ccce569492717b1f0b0186e25cab9.tar.gz
MultiMC-179451d5911ccce569492717b1f0b0186e25cab9.tar.lz
MultiMC-179451d5911ccce569492717b1f0b0186e25cab9.tar.xz
MultiMC-179451d5911ccce569492717b1f0b0186e25cab9.zip
More reformat.
-rw-r--r--Group.cpp3
-rw-r--r--GroupView.cpp25
-rw-r--r--GroupView.h3
-rw-r--r--main.h2
4 files changed, 16 insertions, 17 deletions
diff --git a/Group.cpp b/Group.cpp
index f23066c5..a62f592b 100644
--- a/Group.cpp
+++ b/Group.cpp
@@ -6,8 +6,7 @@
#include "GroupView.h"
-Group::Group(const QString &text, GroupView *view)
- : view(view), text(text), collapsed(false)
+Group::Group(const QString &text, GroupView *view) : view(view), text(text), collapsed(false)
{
}
Group::Group(const Group *other)
diff --git a/GroupView.cpp b/GroupView.cpp
index e3bc1055..94682df8 100644
--- a/GroupView.cpp
+++ b/GroupView.cpp
@@ -30,11 +30,11 @@ GroupView::GroupView(QWidget *parent)
m_categoryMargin(5) //, m_updatesDisabled(false), m_categoryEditor(0), m_editedCategory(0)
{
setViewMode(IconMode);
- //setMovement(Snap);
+ // setMovement(Snap);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setWordWrap(true);
- //setDragDropMode(QListView::InternalMove);
+ // setDragDropMode(QListView::InternalMove);
setAcceptDrops(true);
setSpacing(10);
}
@@ -46,7 +46,7 @@ GroupView::~GroupView()
}
void GroupView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
- const QVector<int> &roles)
+ const QVector<int> &roles)
{
// if (m_updatesDisabled)
// {
@@ -262,8 +262,7 @@ int GroupView::categoryInternalRowTop(const QModelIndex &index) const
return result;
}
-int GroupView::itemHeightForCategoryRow(const Group *category,
- const int internalRow) const
+int GroupView::itemHeightForCategoryRow(const Group *category, const int internalRow) const
{
for (auto &i : category->items())
{
@@ -473,7 +472,8 @@ void GroupView::paintEvent(QPaintEvent *event)
QStyleOptionViewItemV4 option(viewOptions());
option.rect = visualRect(index);
option.widget = this;
- option.features |= QStyleOptionViewItemV2::WrapText; // FIXME: what is the meaning of this anyway?
+ option.features |=
+ QStyleOptionViewItemV2::WrapText; // FIXME: what is the meaning of this anyway?
if (flags & Qt::ItemIsSelectable && selectionModel()->isSelected(index))
{
option.state |= selectionModel()->isSelected(index) ? QStyle::State_Selected
@@ -524,8 +524,9 @@ void GroupView::resizeEvent(QResizeEvent *event)
// if (m_categoryEditor)
// {
- // m_categoryEditor->resize(qMax(contentWidth() / 2, m_editedCategory->textRect.width()),
- //m_categoryEditor->height());
+ // m_categoryEditor->resize(qMax(contentWidth() / 2,
+ //m_editedCategory->textRect.width()),
+ // m_categoryEditor->height());
// }
updateGeometries();
@@ -711,7 +712,7 @@ QModelIndex GroupView::indexAt(const QPoint &point) const
}
void GroupView::setSelection(const QRect &rect,
- const QItemSelectionModel::SelectionFlags commands)
+ const QItemSelectionModel::SelectionFlags commands)
{
for (int i = 0; i < model()->rowCount(); ++i)
{
@@ -746,8 +747,8 @@ QPixmap GroupView::renderToPixmap(const QModelIndexList &indices, QRect *r) cons
return pixmap;
}
-QList<QPair<QRect, QModelIndex>>
-GroupView::draggablePaintPairs(const QModelIndexList &indices, QRect *r) const
+QList<QPair<QRect, QModelIndex>> GroupView::draggablePaintPairs(const QModelIndexList &indices,
+ QRect *r) const
{
Q_ASSERT(r);
QRect &rect = *r;
@@ -791,7 +792,7 @@ QPair<Group *, int> GroupView::rowDropPos(const QPoint &pos)
Group *category = 0;
{
int y = 0;
- foreach(Group * cat, m_categories)
+ for (auto cat : m_categories)
{
if (pos.y() > y && pos.y() < (y + cat->headerHeight()))
{
diff --git a/GroupView.h b/GroupView.h
index e949d892..6d55a462 100644
--- a/GroupView.h
+++ b/GroupView.h
@@ -92,8 +92,7 @@ private:
QPair<int, int> categoryInternalPosition(const QModelIndex &index) const;
int categoryInternalRowTop(const QModelIndex &index) const;
- int itemHeightForCategoryRow(const Group *category,
- const int internalRow) const;
+ int itemHeightForCategoryRow(const Group *category, const int internalRow) const;
QPixmap renderToPixmap(const QModelIndexList &indices, QRect *r) const;
QList<QPair<QRect, QModelIndex>> draggablePaintPairs(const QModelIndexList &indices,
diff --git a/main.h b/main.h
index a1e7f432..47377f7a 100644
--- a/main.h
+++ b/main.h
@@ -30,7 +30,7 @@ public
slots:
void timeout()
{
- foreach(QStandardItem * item, m_items)
+ for (auto item : m_items)
{
int value = item->data(CategorizedViewRoles::ProgressValueRole).toInt();
value += qrand() % 3;