-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
listdialog.h
53 lines (39 loc) · 1 KB
/
listdialog.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef LISTDIALOG_H
#define LISTDIALOG_H
#include <QDialog>
#include <QAbstractListModel>
#include "speaker.h"
class SpeakerListModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit SpeakerListModel(const QList<Speaker> &speakers, QWidget *parent = 0);
~SpeakerListModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
void clear(void);
private:
QList<Speaker> speakers;
};
namespace Ui {
class ListDialog;
}
class ListDialog : public QDialog
{
Q_OBJECT
public:
explicit ListDialog(const QList<Speaker>& speakers, QWidget *parent = 0);
~ListDialog();
void setSpeakerItems(const QList<Speaker> &speakers);
void clear(void);
signals:
void speakerItemSelected(QString title, const Speaker &speaker);
void speakerItemCancelled();
private slots:
void onAccepted();
void onRejected();
private:
Ui::ListDialog *ui;
SpeakerListModel *model;
};
#endif // LISTDIALOG_H