summaryrefslogtreecommitdiffstats
path: root/application/widgets/VersionListView.h
diff options
context:
space:
mode:
Diffstat (limited to 'application/widgets/VersionListView.h')
-rw-r--r--application/widgets/VersionListView.h49
1 files changed, 24 insertions, 25 deletions
diff --git a/application/widgets/VersionListView.h b/application/widgets/VersionListView.h
index b7a881e9..37f7b27e 100644
--- a/application/widgets/VersionListView.h
+++ b/application/widgets/VersionListView.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2018 MultiMC Contributors
+/* Copyright 2013-2019 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,42 +16,41 @@
#pragma once
#include <QTreeView>
-class Mod;
-
class VersionListView : public QTreeView
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit VersionListView(QWidget *parent = 0);
- virtual void paintEvent(QPaintEvent *event) override;
- virtual void setModel(QAbstractItemModel* model) override;
+ explicit VersionListView(QWidget *parent = 0);
+ virtual void paintEvent(QPaintEvent *event) override;
+ virtual void setModel(QAbstractItemModel* model) override;
- enum EmptyMode
- {
- Empty,
- String,
- ErrorString
- };
+ enum EmptyMode
+ {
+ Empty,
+ String,
+ ErrorString
+ };
- void setEmptyString(QString emptyString);
- void setEmptyErrorString(QString emptyErrorString);
- void setEmptyMode(EmptyMode mode);
+ void setEmptyString(QString emptyString);
+ void setEmptyErrorString(QString emptyErrorString);
+ void setEmptyMode(EmptyMode mode);
public slots:
- virtual void reset() override;
+ virtual void reset() override;
protected slots:
- virtual void rowsAboutToBeRemoved(const QModelIndex & parent, int start, int end) override;
- virtual void rowsInserted(const QModelIndex &parent, int start, int end) override;
+ virtual void rowsAboutToBeRemoved(const QModelIndex & parent, int start, int end) override;
+ virtual void rowsInserted(const QModelIndex &parent, int start, int end) override;
private: /* methods */
- void paintInfoLabel(QPaintEvent *event);
- void updateEmptyViewPort();
+ void paintInfoLabel(QPaintEvent *event) const;
+ void updateEmptyViewPort();
+ QString currentEmptyString() const;
private: /* variables */
- int m_itemCount = 0;
- QString m_emptyString;
- QString m_emptyErrorString;
- EmptyMode m_emptyMode = Empty;
+ int m_itemCount = 0;
+ QString m_emptyString;
+ QString m_emptyErrorString;
+ EmptyMode m_emptyMode = Empty;
};