2 * Copyright (C) 2013 Canonical, Ltd.
5 * Pawel Stolowski <pawel.stolowski@canonical.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20#ifndef GENERICOPTIONSMODEL_H
21#define GENERICOPTIONSMODEL_H
25#include <QAbstractListModel>
29class AbstractFilterOption;
31class Q_DECL_EXPORT GenericOptionsModel : public QAbstractListModel
38 GenericOptionsModel(QObject *parent = nullptr);
39 ~GenericOptionsModel();
42 RoleId = Qt::UserRole,
48 QHash<int, QByteArray> roleNames() const override;
49 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
50 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
52 Q_INVOKABLE void setActive(QVector<AbstractFilterOption *>::size_type idx, bool value);
53 Q_INVOKABLE void setActive(const QString &id, bool value);
55 AbstractFilterOption* getRawOption(QVector<AbstractFilterOption *>::size_type idx) const;
58 virtual void ensureTheOnlyActive(AbstractFilterOption *activeOption);
61 void activeChanged(AbstractFilterOption *option);
64 void onOptionChanged();
65 void onActiveChanged();
68 void addOption(AbstractFilterOption *option, int index);
69 void removeOption(int index);
70 int indexOf(const QString &option_id);
72 QVector<AbstractFilterOption *> m_options;
75Q_DECLARE_METATYPE(GenericOptionsModel*)
77#endif // GENERICOPTIONSMODEL_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list