diff options
| author | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2018-02-22 16:54:34 +0100 |
|---|---|---|
| committer | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2018-02-22 16:54:34 +0100 |
| commit | 5e5c9c07291f6b09623d31c92b1fb61c4ede576e (patch) | |
| tree | 0684c123db375336e0e03f0240155a12e744db16 /src/modlistview.cpp | |
| parent | 5ad912e1934061b38825801a27f7c12933878005 (diff) | |
Applied clang-format on source
Diffstat (limited to 'src/modlistview.cpp')
| -rw-r--r-- | src/modlistview.cpp | 65 |
1 files changed, 28 insertions, 37 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp index fe2d3e57..9b98a3b7 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -1,56 +1,47 @@ #include "modlistview.h"
-#include <QUrl>
#include <QMimeData>
#include <QProxyStyle>
+#include <QUrl>
-
-class ModListViewStyle: public QProxyStyle {
+class ModListViewStyle : public QProxyStyle {
public:
- ModListViewStyle(QStyle *style, int indentation);
+ ModListViewStyle(QStyle* style, int indentation);
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter,
+ const QWidget* widget = 0) const;
- 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
+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);
}
- 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));
}
-
|
