aboutsummaryrefslogtreecommitdiff
path: root/selectionhandler.h
blob: dad59cc8c7059adfc2aa64e886968f3e538506f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SELECTIONHANDLER_H
#define SELECTIONHANDLER_H

#include <set>
#include <vector>

#include <QObject>

class SelectionHandler
    : public QObject
{
    Q_OBJECT
public:
    SelectionHandler(int numItems);

signals:
    void selectionChanged(const std::vector<bool> &selection);

public slots:
    void setSelection(const std::vector<bool> &selection);
    void setSelected(int item, bool selected = true);
    void setSelected(const std::set<int> &items, bool selected = true);

private:
    std::vector<bool> m_selection;
};

#endif // SELECTIONHANDLER_H