summaryrefslogtreecommitdiff
path: root/src/modlistview.cpp
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2018-02-23 01:45:58 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2018-02-23 01:45:58 +0100
commitea6292168a6acd4c263913f0ccd7dd64daf4f5cf (patch)
tree312024abbd7c3c100274f3a8031d49096480b654 /src/modlistview.cpp
parent5e5c9c07291f6b09623d31c92b1fb61c4ede576e (diff)
Revert "Applied clang-format on source"
This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e.
Diffstat (limited to 'src/modlistview.cpp')
-rw-r--r--src/modlistview.cpp65
1 files changed, 37 insertions, 28 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp
index 9b98a3b7..fe2d3e57 100644
--- a/src/modlistview.cpp
+++ b/src/modlistview.cpp
@@ -1,47 +1,56 @@
#include "modlistview.h"
+#include <QUrl>
#include <QMimeData>
#include <QProxyStyle>
-#include <QUrl>
-class ModListViewStyle : public QProxyStyle {
-public:
- ModListViewStyle(QStyle* style, int indentation);
- void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter,
- const QWidget* widget = 0) const;
+class ModListViewStyle: public QProxyStyle {
+public:
+ ModListViewStyle(QStyle *style, int indentation);
+ void drawPrimitive (PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget = 0) const;
private:
- int m_Indentation;
+ int m_Indentation;
};
-ModListViewStyle::ModListViewStyle(QStyle* style, int indentation) : QProxyStyle(style), m_Indentation(indentation) {}
+ModListViewStyle::ModListViewStyle(QStyle *style, int indentation)
+ : QProxyStyle(style), m_Indentation(indentation)
+{
+}
-void ModListViewStyle::drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter,
- const QWidget* widget) const {
- if (element == QStyle::PE_IndicatorItemViewItemDrop && !option->rect.isNull()) {
- QStyleOption opt(*option);
- opt.rect.setLeft(m_Indentation);
- if (widget) {
- opt.rect.setRight(widget->width() - 5); // 5 is an arbitrary value that seems to work ok
- }
- QProxyStyle::drawPrimitive(element, &opt, painter, widget);
- } else {
- QProxyStyle::drawPrimitive(element, option, painter, widget);
+void ModListViewStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
+ QPainter *painter, const QWidget *widget) const
+{
+ if (element == QStyle::PE_IndicatorItemViewItemDrop && !option->rect.isNull()) {
+ QStyleOption opt(*option);
+ opt.rect.setLeft(m_Indentation);
+ if (widget) {
+ opt.rect.setRight(widget->width() - 5); // 5 is an arbitrary value that seems to work ok
}
+ QProxyStyle::drawPrimitive(element, &opt, painter, widget);
+ } else {
+ QProxyStyle::drawPrimitive(element, option, painter, widget);
+ }
}
-ModListView::ModListView(QWidget* parent)
- : QTreeView(parent), m_Scrollbar(new ViewMarkingScrollBar(this->model(), this)) {
- setVerticalScrollBar(m_Scrollbar);
+ModListView::ModListView(QWidget *parent)
+ : QTreeView(parent)
+ , m_Scrollbar(new ViewMarkingScrollBar(this->model(), this))
+{
+ setVerticalScrollBar(m_Scrollbar);
}
-void ModListView::dragEnterEvent(QDragEnterEvent* event) {
- emit dropModeUpdate(event->mimeData()->hasUrls());
+void ModListView::dragEnterEvent(QDragEnterEvent *event)
+{
+ emit dropModeUpdate(event->mimeData()->hasUrls());
- QTreeView::dragEnterEvent(event);
+ QTreeView::dragEnterEvent(event);
}
-void ModListView::setModel(QAbstractItemModel* model) {
- QTreeView::setModel(model);
- setVerticalScrollBar(new ViewMarkingScrollBar(model, this));
+void ModListView::setModel(QAbstractItemModel *model)
+{
+ QTreeView::setModel(model);
+ setVerticalScrollBar(new ViewMarkingScrollBar(model, this));
}
+